This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var server = http.createServer(function (request, response) { | |
response.setHeader('content-length', 0); | |
response.end(); | |
}); | |
server.listen(8000, function() { | |
console.log("Server running at http://127.0.0.1:8000/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rugged' | |
repo = Rugged::Repository.new('.') | |
walker = Rugged::Walker.new(repo) | |
walker.push('refs/heads/gh-pages') | |
emails = walker.map do |commit| | |
commit.author[:email] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# goals: | |
# | |
# * find how frequently others contributed (issues or whatever) | |
# * how many contributors there are | |
# | |
# relevant links: | |
# | |
# * https://gist.github.com/afeld/017862706282c10edb6e | |
# * http://octoboard.com/ | |
# * http://bitergia.com/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
Octokit.auto_paginate = true | |
client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN']) | |
teams = client.organization_teams('18F') | |
team = teams.find{|team| team.slug.downcase == '18f' } | |
members = client.team_members(team.id) | |
members.each do |member| | |
puts member.login | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ride4Ruby solution by Aidan Feldman | |
# aidan.feldman@gmail.com | |
# contest: http://www.engineyard.com/blog/2011/january-contest-ride4ruby/ | |
# 1/11/10 | |
require 'rubygems' | |
require 'rest_client' | |
require 'active_support' | |
require 'active_support/core_ext' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is useful inside of an initializer | |
COUNTRIES = [ | |
["United States", "US"], | |
["Afghanistan", "AF"], | |
["Albania", "AL"], | |
["Algeria", "DZ"], | |
["American Samoa", "AS"], | |
["Andorra", "AD"], | |
["Angola", "AO"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// note: this is not tested, but gives you the idea :-) | |
// for a normal html form: | |
$('form').submit(function(){ | |
$(this).find('input.clear-input').each(function(i, elt){ | |
// for each clear-input field | |
if ($(elt).val() === $(elt).initialValue()) { | |
// value has not changed | |
// empty the value | |
$(elt).val(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using soloist to set up a new Lion machine | |
# http://pivotallabs.com/users/cunnie/blog/articles/1872-got-lion-now-get-everything-else- | |
cookbook_paths: | |
- ./workspace | |
recipes: | |
- pivotal_workstation::bash_profile-git_completion | |
- pivotal_workstation::bash_profile-ps1 | |
- pivotal_workstation::dropbox | |
- pivotal_workstation::firefox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sing "99 bottles of beer on the wall..." | |
# sing "98 bottles of beer on the wall..." | |
# ...keep counting down... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Encapsulates the css for a given bit. Prepends the bit name as an ancestor selector, | |
* as well as a "self" selector for each element and class selector found in a sheet.<br><br> | |
* | |
* For example, given a bit with name "myBit", the sheet: | |
* <pre><code> | |
.myClass { color: blue; } | |
.myOtherClass { color: red; } | |
* </pre></code> | |
* would be converted to: |