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 watch = function(obj, prop, callback) { | |
| var oldValue = obj[prop] | |
| , newValue = oldValue | |
| , getter = function() { return newValue; } | |
| , setter = function(value) { | |
| oldValue = newValue; | |
| newValue = value; | |
| callback.call(obj, prop, oldValue, newValue); | |
| }; |
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($) { | |
| 'Use Strict'; | |
| var kendo = window.kendo | |
| , ui = kendo.ui | |
| , Widget = ui.Widget; | |
| var widgetName = Widget.extend({ | |
| init: function(element, options) { | |
| this.el = $(element); |
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
| /** | |
| * Text selection tests | |
| */ | |
| p.sized { | |
| position: absolute; | |
| margin: 0 0 0 50px; | |
| width: 500px; | |
| } | |
| p.padded { | |
| padding: 140px 900px 0 50px; |
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
| /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| a.button { | |
| display: inline-block; | |
| text-align: center; | |
| text-decoration: none; | |
| height: 44px; |
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
| .gist { | |
| font-size: 13px; | |
| line-height: 20px; | |
| margin-bottom: 20px; | |
| width: 100%; | |
| } | |
| .gist pre { | |
| font-family: Menlo,Monaco, 'Bitstream Vera Sans Mono', 'Courier New', monospace !important; | |
| } |
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 anon = { | |
| foo: function() { | |
| return typeof foo; | |
| } | |
| }; | |
| console.log(anon.foo()); // Prints 'undefined' | |
| var named = { | |
| foo: function foo() { |
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
Show hidden characters
| { | |
| "maxerr" : 50, | |
| "bitwise" : true, | |
| "camelcase" : false, | |
| "curly" : false, | |
| "eqeqeq" : true, | |
| "forin" : false, | |
| "immed" : false, | |
| "latedef" : true, |
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 API using Hapi. | |
| // http://hapijs.com | |
| // | |
| var Hapi = require('hapi'); | |
| var quotes = [ | |
| { | |
| author: 'Audrey Hepburn' |
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 local = require('repl').start('> '); | |
| local.context.set = function(name) { | |
| return function(err, value) { | |
| if (err) throw err; | |
| local.context[name] = value; | |
| }; | |
| }; | |
| // |
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 async = require('async') | |
| , Q = require('q') | |
| , fs = require('fs'); | |
| // | |
| // Typical node style function that uses a callback (fn). | |
| // | |
| var piratize = function(file, fn) { | |
| fs.readFile(file, 'utf8', function(err, data) { | |
| if (err) return fn(err, null); |