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
I need a gem. It should have 2 functions. | |
Both functions take a string and a list of words. | |
The first returns the string with all words in the list obfuscated. | |
The second returns data that contains the list of words and their associated frequency. | |
Thanks. |
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 fork = require('child_process').fork; | |
if (process.argv[2] == 'son') { | |
setTimeout(function() { | |
process.send({ result: 'hi dad' }); | |
process.exit(0); | |
}, 1000); | |
} else { | |
var child = fork(__filename, [ 'son' ]); | |
child.on('message', function(m) { |
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
class Comment < ActiveRecord::Base | |
def after_save | |
Resque.enqueue(Notify, self.id) | |
end | |
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
# gem install rspec | |
class Dog | |
attr_reader :height, :distance | |
def initialize(cat) | |
@cat = cat | |
end | |
def jump! |
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 fs = require("fs"); | |
console.log("about to read, yo!"); | |
describe("your mom", function() { | |
it("is fun to talk about her", function() { | |
fs.readFile("spec/foo-spec.js", function(error, buffer) { | |
console.log("Here's the file!"); | |
console.log(buffer); | |
asyncSpecDone(); // comment this out, and it will hang... cuz it's waiting |
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
if false | |
elsif | |
print "hi " | |
else | |
puts "mom" | |
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
#!/usr/bin/env ruby | |
# Print the vaportrail of a ruby file in a git repo, i.e., | |
# the complexity level at each commit. | |
# | |
# Requires: >= bash ?.? | |
# >= git 1.7.1 | |
# >= ruby 1.9.2 | |
# >= flog 2.5.0 | |
# |
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
We need to continually discover what great teams do. | |
Bill Caputo | |
Let the developers do the hiring. | |
Fred George | |
Kill all fear. This enables programmer anarchy. | |
Fred George | |
Webbit, by Joe Walnes |
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
def sort(*l) | |
return l if l.size < 2 | |
eq = l[0] | |
lt = [] | |
gt = [] | |
l.each do |e| | |
if e < eq | |
lt << e | |
end | |
if e > eq |
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
AL JAZEERA ENGLISH | |
http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989 | |
Asia Times Online | |
http://www.atimes.com/atimes/atol.rss | |
Capital Gains and Games | |
http://capitalgainsandgames.com/rss.xml | |
FactCheck.org |