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
function simType(input, value) | |
{ | |
var characters = value.split(''); | |
var i = 0; | |
var id = setInterval(function() | |
{ | |
input.value += characters[i++]; | |
if (i == characters.length) { clearInterval(id); } | |
}, 75); | |
}; |
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 passenger | |
wget http://sysoev.ru/nginx/nginx-0.8.54.tar.gz | |
tar -xvf nginx-0.8.54.tar.gz | |
rm -fr nginx-0.8.54.tar.gz | |
wget https://github.com/agentzh/headers-more-nginx-module/tarball/v0.14 --no-check-certificate | |
tar -xvf v0.14 | |
rm -rf v0.14 | |
mv agentzh-headers-more-nginx-module-2cbbc15/ more-headers-module | |
cd nginx-0.8.54/ |
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 goto: http://msdn.microsoft.com/en-us/data/gg685467 | |
//and this is one of the first thing I see...*horrible* | |
[HttpPost] | |
public ActionResult Create(Blog newBlog) | |
{ | |
try | |
{ | |
using (var db = new BlogContext()) | |
{ |
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
module Document | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def collection | |
Store[self.to_s.tableize] | |
end | |
def find_by_id(id) | |
found = collection.find_one(IdGenerator.from_string(id)) | |
found.nil? ? nil : self.new(unmap(found)) | |
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
it "sorts the result by ascending date" do | |
User.should_receive(:find).with(anything(), hash_including(:sort => [:date, Mongo::ASCENDING])) | |
User.most_recent | |
end | |
#vs | |
# some common and fixed data for the entire fixture | |
# I'm pulling this out because I don't want the setup to seem like a big deal, because I don't think it is | |
def setup |
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 Array | |
def select_index | |
values = [] | |
self.each_index{|i| values << self[i] if yield i } | |
values | |
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
it "deletes the leaderboard" do | |
leaderboard = Factory.create(:leaderboard) | |
Leaderboard.count.should == 1 #just can't help myself | |
leaderboard.destroy | |
Leaderboard.count.should == 0 | |
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
original existed at: http://news.ycombinator.com/item?id=2703771 (comments still exist) | |
Perhaps grumpiness has got the best of me this morning, but this is at least the second time that I've seen the "Our office is too big -- we need some badass hackers to fill it up", job posting on HN and something about it grates me the wrong way. | |
First, the formatting is brutal. It is possibly a markup language I simply don't recognize – but then, neither does HN. The different roles blend into each other, the spacing is all uniform removing any visual grouping. | |
Second, the content is childish. It screams (to me) of either unprofessionalism or fake-cool. What's "TONS" of experience? What does "physically live at a ton of smb's" mean? Are you saying the product is already in use by a lot of business that hire mostly fat employees? What's an "extremely small core dev team"? 1? Scaling "really big stuff"? Like a mountain? Finally, the salary description includes "blah blah blah". | |
Here's a writing tip, words that end in |
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
import ("testing") | |
func TestEmptyReturnsTrueWhenEmpty(t *testing.T) { | |
if (new(LinkedList).IsEmpty() == false) { | |
t.Fatal("Expecting list to be empty") | |
} | |
} |
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
package hatch | |
type Element struct { | |
next *Element | |
Value interface{} | |
} | |
func (e *Element) Next() (*Element) { return e.next } | |
type LinkedList struct { |