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 'thread' | |
| require 'json' | |
| require 'net/http' | |
| require 'uri' | |
| require 'betabrite' | |
| require 'psych' | |
| require 'usb' | |
| class StreamClient | |
| def initialize user, pass |
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
| /* | |
| example design of an expandable list view that expands selected items in place using alternate list item view | |
| */ | |
| tasksView: SC.ScrollView.design({ | |
| hasHorizontalScroller: NO, | |
| layout: { top: 24, bottom: 0, left: 0, right: 0 }, | |
| backgroundColor: 'white', | |
| contentView: Tasks.ExpandableListView.design({ | |
| contentBinding: 'Tasks.controller.arrangedObjects', | |
| selectionBinding: 'Tasks.controller.selection', |
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
| class Batman.SetTransform extends Batman.Set | |
| constructor: (@source, observedItemKeys..., @transform) -> | |
| super() | |
| @transformIndex = new Batman.SimpleHash | |
| if @source.isObservable | |
| @_setObserver = new Batman.SetObserver(@source) | |
| @_setObserver.observedItemKeys = observedItemKeys | |
| @_setObserver.observerForItemAndKey = @observerForItemAndKey | |
| @_setObserver.on 'itemsWereAdded', @add | |
| @_setObserver.on 'itemsWereRemoved', @remove |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Test App</title> | |
| <script type="text/javascript" src="../lib/es5-shim.js"></script> | |
| <script type="text/javascript" src="../lib/batman.js"></script> | |
| <script type="text/javascript" src="../lib/batman.solo.js"></script> | |
| <script type="text/javascript" src="../lib/extras/batman.rails.js"></script> | |
| <script type="text/javascript" src="../lib/coffee-script.js"></script> | |
| </head> |
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
| var flatiron = require('flatiron'), | |
| app = flatiron.app; | |
| console.log('What\'s that in your hand? Look down,'); | |
| app.use(require('./tickets')); | |
| console.log('look up. I HAVE IT. It\'s ' + app.qty + ' TICKETS to ' + app.description + '!'); | |
| console.log('Look again.'); | |
| app.use(require('./diamonds')); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.22.0"></script> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.22.0"></script> | |
| <script type="text/javascript" src="readme.js"></script> | |
| <style type="text/css"> | |
| .node { |
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
| // Compute the edit distance between the two given strings | |
| exports.getEditDistance = function(a, b){ | |
| if(a.length == 0) return b.length; | |
| if(b.length == 0) return a.length; | |
| var matrix = []; | |
| // increment along the first column of each row | |
| var i; | |
| for(i = 0; i <= b.length; i++){ |
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 sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
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
| # Just wanted to clarify my points at the meetup last night. | |
| # | |
| # There were two different issues intertwined: | |
| # (1) Whether to use extend or "include as extend" | |
| # (2) When using "include as extend", what is the simplest way to achieve the goal? | |
| # | |
| # My personal opinion is that the answer to (1) is "extend", not "include as extend", but that | |
| # is just my personal opinion. My answer to (2) is a more empirical question. | |
| # Using the "extend" approach. Again, I personally prefer the simplicity of this approach, but |
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
| -- PostgreSQL 9.2 beta (for the new JSON datatype) | |
| -- You can actually use an earlier version and a TEXT type too | |
| -- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8 | |
| -- JSON Types need to be mapped into corresponding PG types | |
| -- | |
| -- Number => INT or DOUBLE PRECISION | |
| -- String => TEXT |