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
| function eq_classes(set, rel) { | |
| var classes = {}, connected_stack, root, | |
| stack_top, elt, pushed_more; | |
| while(set.length > 0) { | |
| root = set.shift(); | |
| classes[root] = [root]; | |
| connected_stack = [root]; | |
| while(connected_stack.length > 0) { |
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
| eq_classes( | |
| [0,1,2,3,4,5,6,7,8], | |
| function(a,b) { return Math.abs(a-b) === 3; } | |
| ); | |
| // returns {0: [0,3,6], 1: [1,4,7], 2: [2,5,8]} |
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
| info: Welcome to Nodejitsu begriffs | |
| info: jitsu v0.12.10-2, node v0.10.5 | |
| info: It worked if it ends with Nodejitsu ok | |
| info: Executing command deploy | |
| info: Analyzing application dependencies in node server.js | |
| debug: { method: 'GET', | |
| debug: uri: 'https://api.nodejitsu.com/apps/begriffs/pace', | |
| debug: headers: | |
| debug: { Authorization: '*****************************************************************', | |
| debug: 'Content-Type': 'application/json' }, |
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
| if (typeof define !== 'function') { | |
| /* jshint latedef:false */ | |
| var define = require('amdefine')(module); | |
| } | |
| define(function () { | |
| function MyModule() { | |
| // ... | |
| } |
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 mod = new (require('my-module')); |
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(['my-module'], function (MyModule) { | |
| var mod = new MyModule(); | |
| }); |
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
| <body> | |
| <div> | |
| Zip code: | |
| <input type='text' id='zipcode' value=''/> | |
| <button id="lookup">Lookup City</button> | |
| </div> | |
| <div> | |
| City, State | |
| <input type='text' id='city'/>, <input type='text' id='state'/> | |
| </div> |
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
| <html> | |
| <head> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/masonry/3.0.0/masonry.pkgd.js"></script> | |
| <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> | |
| <script type="text/javascript"> | |
| $(function () { | |
| var container = document.querySelector('body'); | |
| var msnry = new Masonry( container, { | |
| itemSelector: 'div' | |
| }); |
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
| ghci> -- yawn | |
| ghci> 5 == 5 | |
| true | |
| ghci> 5 == "a string" | |
| <interactive>:3:1: | |
| No instance for (Num [Char]) arising from the literal `5' | |
| Possible fix: add an instance declaration for (Num [Char]) | |
| In the first argument of `(==)', namely `5' | |
| In the expression: 5 == "a string" |
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
| ghci> :t (==) | |
| (==) :: Eq a => a -> a -> Bool |