Skip to content

Commit

Permalink
Opt-in by starring resume.github.com project.
Browse files Browse the repository at this point in the history
  • Loading branch information
trans committed Nov 19, 2013
1 parent 1e45a8e commit d9dca6e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 46 deletions.
14 changes: 5 additions & 9 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
####A service that creates your resume based on your GitHub repos.
#### A service that creates your resume based on your GitHub repos.

Possible Usecases:

* Boon for all the tech-savy bosses who want to have a **quick view** of person's git/github activity, _before the interview_

### Opt-Out
### Opt-In

Thanks to @augustl, folks are now able to opt-out. I agree the process is still a tad laborious but basically here's how you opt-out.
GitHub Resume is now opt-in rather than opt-out! To make your resume visible
just **star** this project, [resume/resume.github.com](https://github.com/resume/resume.github.com).
That's all there is to it!

1. Fork this repo
2. In your forked repository, add your username to the file `js/opt_out_users.js`, save, and push to your repository.
3. Issue a pull request to resume/resume.github.com
4. I'll merge.

The other way, which can take longer due to the fact that I (@davidcoallier) am bound by the current contraints of our time-space continuum is to ask politely (with a please and thanks (thanks is optional)) on Twitter.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="js/mustache.js"></script>
<script type="text/javascript" src="js/opt_out_users.js"></script>
<script type="text/javascript" src="js/githubresume.js"></script>
</head>
<body id="resume">
Expand Down
26 changes: 25 additions & 1 deletion js/githubresume.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,36 @@ var github_user_orgs = function(username, callback) {
$.getJSON('https://api.github.com/users/' + username + '/orgs?callback=?', callback);
}

var github_user_stars = function(username) {
var repos = [];
$.ajax({
url: 'https://api.github.com/users/' + username + '/starred',
async: false,
dataType: 'json',
success: function(json) {
repos = json;
}
});
return repos;
}

var github_user_starred_resume = function(username) {
var starred = false;
var repos = github_user_stars(username);
$.each(repos, function(i, repo) {
if (repo.full_name == "resume/resume.github.com") {
starred = true;
}
});
return starred;
}

var run = function() {
var itemCount = 0,
maxItems = 5,
maxLanguages = 9;

if (githubresume_opt_out_users.indexOf(username) >= 0) {
if (! github_user_starred_resume(username)) {
$.ajax({
url: 'views/opt_out.html',
dataType: 'html',
Expand Down
35 changes: 0 additions & 35 deletions js/opt_out_users.js

This file was deleted.

0 comments on commit d9dca6e

Please sign in to comment.