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
| This is gist. | |
| There are many like it, but this one is mine. | |
| It is my life. | |
| I must master it as I must master my life. | |
| Without me gist is useless. | |
| Without gist, I am useless. |
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 node | |
| var argv = require('optimist') | |
| .usage('Usage: --key=[consumer key] -secret=[consumer secret]') | |
| .demand(['key', 'secret']) | |
| .argv | |
| ; | |
| var OAuth = require('oauth').OAuth; | |
| var Step = require('step'); |
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 node | |
| var fs = require("fs") | |
| , path = require("path") | |
| , npm = require("npm") | |
| , readJSON = require("npm/utils/read-json"); | |
| npm.load(function(){ | |
| readJSON(process.argv[2], function(err, data){ | |
| if(err) throw err; |
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 dependencies | |
| */ | |
| var Vector = require('../public/lib/vector'), | |
| _floor = Math.floor; | |
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
| // Target API: | |
| // | |
| // var s = require('net').createStream(25, 'smtp.example.com'); | |
| // s.on('connect', function() { | |
| // require('starttls')(s, options, function() { | |
| // if (!s.authorized) { | |
| // s.destroy(); | |
| // return; | |
| // } | |
| // |
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.extensions[".json"] = function (module, filename) { | |
| module.exports = JSON.parse(require("fs").readFileSync(filename, "utf8")) | |
| } |
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
| loadSpecs = (paths...) -> | |
| # expand all spec paths to full cache busted file paths | |
| paths = for path in paths | |
| "spec/#{path}_spec.js?#{new Date().getTime()}" | |
| # Load the specs with head.js, and start a spec run 1 second after they load. | |
| head.js paths..., -> | |
| setTimeout -> | |
| jasmine.getEnv().addReporter(new jasmine.TrivialReporter()) | |
| jasmine.getEnv().execute() |
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
| $.fn.extend | |
| myplugin: (options) -> | |
| self = $.fn.myplugin | |
| opts = $.extend {}, self.default_options, options | |
| $(this).each (i, el) -> | |
| self.init el, opts | |
| self.log el if opts.log | |
| $.extend $.fn.myplugin, | |
| default_options: |
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 fs = require('fs'); | |
| var child_process = require('child_process'); | |
| var spawn = child_process.spawn; | |
| function openEditor(file) { | |
| var cp = spawn(process.env.EDITOR, [file], { | |
| customFds: [ | |
| process.stdin, | |
| process.stdout, | |
| process.stderr |
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
| namespace = (target, name, block) -> | |
| [target, name, block] = [(if typeof exports isnt 'undefined' then exports else window), arguments...] if arguments.length < 3 | |
| top = target | |
| target = target[item] or= {} for item in name.split '.' | |
| block target, top |
OlderNewer