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 Memcached in Javascript | |
| * @Author: Sun, Junyi | |
| * @Email: ccnusjy@gmail.com | |
| * @Date: 2012-8-3 | |
| */ | |
| var net = require('net'); | |
| var store = {} | |
| function handle_header(header,crlf_len){ | |
| var tup = header.split(" ") |
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
| // Tokenahead.less | |
| // --------------- | |
| .tokenahead { | |
| cursor: text; | |
| overflow: hidden; | |
| height: auto; | |
| padding-bottom: 0; | |
| border-color: @inputBorder; | |
| } |
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 nums = [35, 25, 53, 3, 102, 203, 230, 1005]; | |
| // Figure out the number of binary digits we're dealing with | |
| var k = Math.max.apply(null, nums.map(function(i) { | |
| return Math.ceil(Math.log(i)/Math.log(2)); | |
| })); | |
| for (var d = 0; d < k; ++d) { | |
| for (var i = 0, p = 0, b = 1 << d, n = nums.length; i < n; ++i) { | |
| var o = nums[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
| // For context on difficulties of subclassing Array: | |
| // See, http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/ | |
| var sandbox = {}; | |
| require('vm').createScript('SubArray = Array').runInNewContext(sandbox); | |
| var SubArray = sandbox.SubArray; | |
| console.log(SubArray); | |
| SubArray.prototype.__proto__ = { | |
| __proto__: Array.prototype, |
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
| /*jslint regexp: true, maxerr: 50, indent: 2 */ | |
| (function (global) { | |
| "use strict"; | |
| function URLUtils(url, baseURL) { | |
| var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); | |
| if (!m) { | |
| throw new RangeError(); | |
| } |
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
| <?php | |
| // Use in the "Post-Receive URLs" section of your GitHub repo. | |
| if ( $_POST['payload'] ) { | |
| shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' ); | |
| } | |
| ?>hi |
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 ruby | |
| require 'ftools' | |
| require 'fileutils' | |
| require 'rubygems' | |
| require 'RMagick' | |
| include Magick | |
| require 'open3' | |
| def merge( files = [] ) |
NewerOlder