Skip to content

Instantly share code, notes, and snippets.

setup_socket
fork {
accept_connection
handle_connection (with select())
}
waitall
diff --git a/haystack/models.py b/haystack/models.py
index ab5f401..7777bf8 100644
--- a/haystack/models.py
+++ b/haystack/models.py
@@ -3,6 +3,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils.encoding import force_unicode
from django.utils.text import capfirst
+from django.utils.translation import ugettext_lazy as _
@defunkt
defunkt / gist:186983
Created September 14, 2009 23:00 — forked from rcarver/gist:185656
class SomeFastJob
@queue = :high
def self.perform
fast_stuff
end
end
class SomeSlowJob
@queue = :low
RAILS_ROOT ||= ENV["RAILS_ROOT"]
namespace :bundle do
js_bundle = Rails.root + "/public/javascripts/bundle.js"
js_files = Dir[Rails.root + "/public/javascripts/{github,jquery}.*.js"].sort
task :all => [ js_bundle, :gist_js, :css ]
file js_bundle => js_files do |task|
require 'lib/js_minimizer'
@defunkt
defunkt / hooks.rb
Created August 17, 2009 15:55 — forked from lazyatom/hooks.rb
module Rip
module Commands
# Runs ~/.rip/active/hooks/used after `rip use`
# and ~/.rip/active/hooks/will-leave when moving to another env
alias_method :rip_use, :use
def use(*args)
run_hook_if_exists('before-leave', Rip::Env.active)
rip_use(*args)
run_hook_if_exists('after-use', Rip::Env.active)
end
$ python
Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
$
require "benchmark"
require "fileutils"
def test
path = "/tmp/faketest"
FileUtils.mkdir_p("#{path}/public/stylesheets")
FileUtils.mkdir_p("#{path}/public/javascripts")
FileUtils.mkdir_p("#{path}/public/images")
FileUtils.mkdir_p("#{path}/views/templates")
FileUtils.mkdir_p("#{path}/views/layouts")
person = Person.new
person.name
person.name = name
person.setFirstName(first, lastName:last)

Hi, my name is ByunTae from South Korea. I have been playing Starcraft since 1998 and I was born and raised in Korea. I'm 100% full blooded Korean, meaning I have been gifted with unparallel talent to master any video game, particularly, Starcraft: Brood War. I'm also experienced in Counter-Strike, I am able to perform bunny hops, my best score on a public 32 player game was 171-2 with 170 kill streak. I'm offering my expertise in Starcraft to be taught to non-Koreans that wishes to have the skill of a Korean player. I have advised and coached many professional gamers such as Im Jae Dong, Park Myung Soo, Ma Jae Yoon, and more. Boxer and I were great friends until he started using my dropships to gain his fame. I started training other players to be on par with Boxer and eventually surpassing Boxer. He is no longer the best player thanks to my contribution to rest of the players. I did not compete in pro gaming because they KTF did not agree with my seven figure contract demand.

Things I will be teaching in

{:one => 1, :two => 2}.select {|k,v| k == :one} #=> [[:one, 1]]
{:one => 1, :two => 2}.reject {|k,v| k == :one} #=> {:two=>2}