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
| 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
| 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 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
| 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 | |
| } |
NewerOlder