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
url = "http#{schemes.sample}://#{ | |
#subdomains | |
tlds.sample(1 + rand(3)).join('.') | |
}.#{ | |
#host | |
host | |
}.#{ | |
#tlds | |
tlds.sample | |
}#{ |
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
{ | |
"7fb0d9"=>6028200, | |
"366d16"=>6035040, | |
"57d44a"=>6020760, | |
"d32228"=>6019140, | |
"027d29"=>6043620, | |
"cbc570"=>6000600, | |
"5f0756"=>6029820, | |
"798c69"=>6043860, | |
"803566"=>6024780, |
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 ConcurrentHashMap < Hash; end | |
ConcurrentHashMap.send(:include,(Module.new do | |
def []=(key,value) | |
warn 'This method is slow' | |
super(key,value) | |
end | |
end)) | |
h = ConcurrentHashMap.new |
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 I18n | |
class << self | |
def translate(*args) | |
args.inspect | |
end | |
def localize(*args) | |
args.inspect | |
end | |
alias_method :l, :localize |
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
<div id="sas"> | |
<embed src="http://rich-ads.s3.amazonaws.com/a27f1e29edc38a7be523ad69b6b73258.swf" name="FlashID1x" quality="autohigh" wmode="opaque" swliveconnect="true" width="1010" height="120" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" title="Flash"> | |
</div> |
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 do_something | |
yield 'something' | |
end | |
do_something do |thing| | |
puts thing | |
end | |
def do_complex(first, second) | |
thing = 'nothing' |
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 createWindow = function() { | |
var events = kafkaFactory(); | |
var register = function(wantedObj, wantedType, callback) { | |
events.register(function(obj, type, event) { | |
if (wantedObj === obj && wantedType === type) { | |
callback(event); | |
} | |
}); | |
}; | |
var evented = function() { |
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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package hello; | |
import javax.swing.JFrame; | |
import javax.swing.JLabel; | |
/** |
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
$ sh keepalive.sh | |
Normal get | |
HTTP/1.1 200 OK | |
Server: nginx | |
Date: Fri, 30 Nov 2012 11:38:26 GMT | |
Content-Type: text/plain | |
Content-Length: 2 | |
Connection: keep-alive |
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
jQuery('.song-name a').each(function() { | |
var e = $(this) | |
var frame = $('<iframe/>') | |
frame.attr('src', e.attr('href')); | |
frame.attr('height', '200px') | |
frame.attr('width', '500px') | |
e.parent().parent().after(frame); | |
var w = frame.first()[0].contentWindow; | |
w.addEventListener('load', function() { | |
w.scroll(0,300) |