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
| words = { | |
| 'hello' => 100, | |
| 'world' => 50, | |
| 'this' => 200, | |
| } | |
| storage = {} | |
| sum = 0 | |
| words.each do |word, weight| |
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
| cradle: require 'cradle' | |
| sys: require 'sys' | |
| p: () -> | |
| for arg in arguments | |
| sys.puts(sys.inspect(arg, false, 5)) | |
| class ModelInstance | |
| constructor: (doc) -> | |
| @doc: doc |
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
| vows: require 'vows' | |
| assert: require 'assert' | |
| Kimochi: require './kimochi' | |
| model: Kimochi.connect 'vows_spec' | |
| vows.describe('Kimochi', | |
| { 'A model creates the database': { | |
| topic: -> model.create @callback | |
| 'without errors': (result) -> |
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
| iota github/manveru/kimochi % vows spec.coffee | |
| ✗ | |
| /home/manveru/.node_libraries/.npm/vows/0.4.6/package/lib/vows/context.js:28 | |
| if (e) { that.emitter.emit('error', e) } | |
| ^ | |
| TypeError: Cannot call method 'emit' of null | |
| at /home/manveru/.node_libraries/.npm/vows/0.4.6/package/lib/vows/context.js:28:47 | |
| at EventEmitter._tickCallback (node.js:50:25) | |
| at node.js:255:9 |
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
| #!/usr/bin/env coffee | |
| # Ext JS Connect | |
| # Copyright(c) 2010 Ext JS, Inc. | |
| # MIT Licensed | |
| # Module dependencies. | |
| child_process: require 'child_process' | |
| netBinding: process.binding 'net' |
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
| require './examples/javascript' | |
| sys: require 'sys' | |
| p: (obj) -> sys.puts(sys.inspect(obj, false, 100)) | |
| p JSGrammar.parse('something.that(/works/)') |
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
| require 'activesupport' | |
| module Password | |
| VERSION = '1.0.0' | |
| FILENAME = "#{ENV['HOME']}/.they_stole_my_facebook_login_oh_noez" # honestly, "security", who gives a shit | |
| SITES = {} | |
| def set(credentials) | |
| SITES[credentials[:site]] = {:username => credentials[:username], | |
| :password => credentials[:password]} | |
| end | |
| def username(site) |
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
| # Simple RPN calculator with stack. | |
| # Example usage: | |
| # >> 400 400 400 * | |
| # Top of stack: 64000000 | |
| # >> 40 40 * | |
| # Top of stack: 102400000000 | |
| # >> 40 | |
| # Top of stack: 40 | |
| # >> 30 | |
| # Top of stack: 30 |
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 Ramaze | |
| module Helper | |
| module ReCaptcha | |
| # Call this to generate the actual ReCaptcha script into your template. | |
| # Options can include | |
| # [rcc_pub] public recaptcha key (defaults to RCC_PUB constant) | |
| # [rcc_priv] privte recaptcha key (defaults to RCC_PRIV constant) | |
| # [ssl] generate ssl-based output, defaults to false | |
| # | |
| # This method also sets :rcc_err into the session. |
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
| url: require 'url' | |
| querystring: require 'querystring' | |
| request: require 'request' | |
| class Rpx | |
| constructor: (apiKey) -> | |
| @apiKey: apiKey | |
| authInfo: (token, callback) -> | |
| @apiCall 'auth_info', {token: token}, (data) -> |