Discover gists
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
self.pr = function() { | |
var literal = "[" | |
for (var i=0; i<self.length; i++) | |
literal += (i != self.length-1) ? self[i]+", " : self[i]+"]" | |
return literal | |
} |
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 foo (bar) | |
>> "#{bar} baz" | |
>> end | |
=> nil | |
>> (0..5).collect &method(:foo) | |
=> ["0 baz", "1 baz", "2 baz", "3 baz", "4 baz", "5 baz"] | |
>> method(:foo) | |
=> #<Method: Object#foo> |
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
(Math.round(0xFFFFFF * Math.random()).toString(16) + "000000").replace(/([a-f0-9]{6}).+/, "#$1").toUpperCase(); |
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 'find' | |
require 'rubygems' | |
require 'rake' | |
desc "Remove minified CSS and JS files from this directory and its children." | |
task :killmin do | |
Find.find(File.dirname(__FILE__)) do |path| | |
if FileTest.directory?(path) | |
if File.basename(path)[0] == ?. | |
Find.prune # Don't look any further into this directory. |
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
self.eq = function(other) { | |
// Is self equal to other? | |
if (self.length !== other.length) return 0 | |
var equal = 1 | |
for (var i=0; i<self.length; i++) { | |
if (self[i] !== other[i]) equal = 0 | |
} | |
return equal | |
} |
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
// ==UserScript== | |
// @name Autopagerize for haiku | |
// @namespace http://rails2u.com/ | |
// @include http://h.hatena.ne.jp/* | |
// @include http://h.hatena.com/* | |
// ==/UserScript== | |
var THRESHOLD = 800; | |
var w = unsafeWindow; |
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
# Author: Dirceu Pereira Tiegs <dirceutiegs@gmail.com> | |
# | |
# Script usado para gerar nomes de tavernas | |
# | |
class Array | |
def pick | |
self.sort_by {rand}[0] | |
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
class def | |
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
// ==UserScript== | |
// @name gist.user.js | |
// @namespace http://github.com/hotchpotch | |
// @description install greasemonkey (user.js) | |
// @include http://gist.github.com/* | |
// @include https://gist.github.com/* | |
// ==/UserScript== | |
(function() { | |
$X('id("files")//div[@class="info"]/span').forEach(function(e) { |
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
jin mishuku | |