this is some code
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
;; This buffer is for notes you don't want to save, and for Lisp evaluation. | |
;; If you want to create a file, visit that file with C-x C-f, | |
;; then enter the text in that file's own buffer. | |
Hello World! |
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
(defun rli-add-jasmine-externs() | |
(when (string-match "_spec.js" (buffer-file-name)) | |
(setq js2-additional-externs | |
'("jasmine" "describe" "xdescribe" "it" "xit" "expect" "spyOn" | |
"beforeEach" "afterEach" "runs" "waits" "waitsFor"))) | |
) | |
(add-hook 'js2-mode-hook 'rli-add-jasmine-externs) |
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 engine = require("./engine").engine; | |
var client, task, intake, exhaust, cylinder, logging_gateway, stdout_client, logging_opts; | |
logging_gateway = engine.logging_gateway.create(); | |
stdout_client = engine.logging_stdout_client.create(); | |
logging_gateway.add_logger(stdout_client); | |
logging_opts = { | |
logging_gateway: logging_gateway | |
}; |
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 fetch = function(resource, options, callback){ | |
var url = require("url"); | |
var http = require("http"); | |
var parsed_url = url.parse(resource); | |
var http_options = { | |
host: parsed_url.hostname, | |
port: parsed_url.port || 80, | |
path: parsed_url.pathname + (parsed_url.search || "") + (parsed_url.hash || ""), | |
method: options.method || "GET" |
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
* Rack | |
- Rack::FiberPool provides a Fiber for each request | |
* Application Server | |
- Thin: starts its own EM reactor | |
- Passenger: Start a new reactor in a new thread | |
- Other: Start a new reactor in a new thread | |
* Rails | |
- initialzier: Start a new EM reactor (depending on app server) |
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
* Don't mock interfaces that you do not own | |
* Do not do real work in the constructor | |
* Respect the law of demeter | |
* Tell dont ask | |
* Use concrete mock objects |
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 vm = require("vm"), | |
util = require("util"), | |
events = require("events"); | |
var fooClass = function(){}; | |
util.inherits(fooClass, events.EventEmitter); | |
fooClass.prototype.run = function(){ | |
this.emit('myevent', "Hello!"); | |
}; |
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
(if (< emacs-major-version 24) | |
(load "~/.emacs_23") | |
(load "~/.emacs24.d/init.el")) |
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 AcmeServiceClient | |
def initialize(http_client, acme_response_translator) | |
self.http_client = http_client | |
self.acme_response_translator = acme_response_translator | |
end | |
def self.make(dependencies) | |
instance = self.new(dependencies["http_client"], dependencies["acme_response_translator"]) | |
return instance | |
end |
OlderNewer