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 linkify = (function() { | |
| var replaceSubstr = function(text, i, j, substr) { | |
| return text.substr(0, i) + substr + text.substr(j); | |
| } | |
| var mergeByIndices = function(a, b) { | |
| var i = 0, j = 0, result = []; | |
| while (i < a.length || j < b.length) { | |
| if (i < a.length && (j >= b.length || a[i].indices[0] < b[j].indices[0])) | |
| result.push(a[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
| // Copyright (C) 2012 Benoit Sigoure | |
| // Copyright (C) 2012 StumbleUpon, Inc. | |
| // This library is free software: you can redistribute it and/or modify it | |
| // under the terms of the GNU Lesser General Public License as published by | |
| // the Free Software Foundation, either version 2.1 of the License, or (at your | |
| // option) any later version. This program is distributed in the hope that it | |
| // will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | |
| // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser | |
| // General Public License for more details. You should have received a copy | |
| // of the GNU Lesser General Public License along with this program. If not, |
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
| // ==UserScript== | |
| // @name Trello Activity | |
| // @namespace http://fluidapp.com | |
| // @description Displays a Growl notification for new activities every 5 seconds. Also updates the badge. | |
| // @include * | |
| // @author Michael Lopez ([email protected]) | |
| // ==/UserScript== | |
| (function () { | |
| if (window.fluid) { |
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 Sencha | |
| module NestedListMenu | |
| class << self | |
| # Sencha Touch nested list menu requires json in the form of: | |
| # | |
| # {"text": "some identifier", | |
| # "children": ["text": "child identifier", "other": "info", "leaf": "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
| var express = require('express') | |
| , cookieSessions = require('./cookie-sessions'); | |
| var app = express(); | |
| app.use(express.cookieParser('manny is cool')); | |
| app.use(cookieSessions('sid')); | |
| app.get('/', function(req, res){ | |
| req.session.count = req.session.count || 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
| var express = require('express'), | |
| requirejs = require('requirejs'), | |
| app = module.exports = express.createServer(); | |
| app.configure('development', function(){ | |
| // Use development version of static files | |
| app.use(express.static(__dirname + '/public')); | |
| }); | |
| app.configure('production', function(){ |
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 libraries | |
| var os = require("os"); | |
| var fs = require("fs"); | |
| var readline = require("readline"); | |
| var cluster = require("cluster"); | |
| var express = require("express"); | |
| var site = express(); | |
| // Var up, bro | |
| var i, read; |
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 | |
| require 'autoload.php'; | |
| $redis = new Predis\Client('tcp://127.0.0.1', 'dev'); | |
| // *** NOTE *** Lua's unpack() has a limit on the size of the table imposed by | |
| // the number of Lua stack slots that a C function can use. This value is defined | |
| // by LUAI_MAXCSTACK in luaconf.h and for Redis is set to 8000, which translates | |
| // to an hash of 4000 elements since HGETALL returns a list that interleaves field |
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
| #!/bin/sh | |
| ##3.5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80 | |
| ## | |
| ## Debian / Linux / Ubuntu / LSB | |
| ## Startup script for Express / Node.js application with the forever module | |
| ## | |
| ## | |
| ## A modification of "init.d.lsb.ex" by Nicolas Thouvenin | |
| ## | |
| ## |
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 | |
| # Configure | |
| $DB_USER = 'admin'; | |
| $DB_PASS = 'qwerty'; | |
| $DB_HOST = 'localhost'; | |
| $DB_NAME = 'postgis-2-0'; | |
| // Param 3 when ran in shell will override this value | |
| $DB_TABLE = 'public.florida_establishments_garman'; | |
| // Param 2 when ran in shell will override this value | |
| $CATEGORY = 'misc'; |