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 | |
| spawn = require('child_process').spawn, | |
| fs = require('fs'), | |
| gulp = require('gulp'), | |
| watch = require('gulp-watch'); | |
| var SERVER_SRC = './server/' | |
| var paths = { | |
| server: [SERVER_SRC+'*', SERVER_SRC+'**/*'] |
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
| /** | |
| * Load and cache JSONP data | |
| */ | |
| var loadJSONP = function ( url, callback ) { | |
| var setLocalData = false; | |
| /* | |
| * Setting a variable callback method since we're writing to window | |
| */ | |
| var callbackMethod = url.replace(/[^a-z0-9]/g, '_') |
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
| (map #(hash-map :_id (:id %) :_rev (:rev (:value %))) (get_all {})) | |
| (use 'clojure.walk) | |
| (def grouped-by-key (keywordize-keys grouped)) | |
| (count (keys grouped-by-key)) | |
| (defn delete-duplicates | |
| [items] | |
| (if (not= 0 (count items)) |
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
| "["A# .NET","A# (Axiom)","A-0 System","A+","A++","ABAP","ABC","ABC ALGOL","ABLE","ABSET","ABSYS","ACC","Accent","Ace DASL","ACL2","ACT-III","Action!","ActionScript","Ada","Adenine","Agda","Agilent VEE","Agora","AIMMS","Alef","ALF","ALGOL 58","ALGOL 60","ALGOL 68","ALGOL W","Alice","Alma-0","AmbientTalk","Amiga E","AMOS","AMPL","APL","App Inventor for Android's visual block language","AppleScript","Arc","ARexx","Argus","AspectJ","Assembly language","ATS","Ateji PX","AutoHotkey","Autocoder","AutoIt","AutoLISP / Visual LISP","Averest","AWK","Axum","B","Babbage","Bash","BASIC","bc","BCPL","BeanShell","Batch (Windows/Dos)","Bertrand","BETA","Bigwig","Bistro","BitC","BLISS","Blue","Bon","Boo","Boomerang","Bourne shell","bash","ksh","BREW","BPEL","C","C--","C++","C#","C/AL","Caché ObjectScript","C Shell","Caml","Candle","Cayenne","CDuce","Cecil","Cel","Cesil","Ceylon","CFEngine","CFML","Cg","Ch","Chapel","CHAIN","Charity","Charm","Chef","CHILL","CHIP-8","chomski","ChucK","CICS","Cilk","CL","Claire","Clarion","Clean" |
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
| app_navModule = ()-> | |
| nav = {} | |
| nav.Link = (data) -> | |
| data.attributes = data.attributes or {} | |
| @href = m.prop(data.href) | |
| @text = m.prop(data.text) | |
| @attributes = m.prop(data.attributes) | |
| 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
| import sys | |
| lines = open(sys.argv[1], 'r') | |
| for line in lines: | |
| line = line.replace("\n", "").split(";") | |
| arr = line[0].split(",") | |
| n = int(line[1]); | |
| hsh = {} |
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 dep = require('somelib'); | |
| module.exports = { | |
| myMethod: function(callback){ | |
| dep.doSomething(function(err, res){ | |
| callback(err, res); | |
| }); | |
| } | |
| }; |
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
| <!doctype html> | |
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <script src="bower_components/engine.io-client/engine.io.js"></script> | |
| </head> |
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
| import itertools | |
| groups = [ | |
| ['wordlist1'], | |
| ['wordlist2'] | |
| ] | |
| combos = list(itertools.product(*groups)) | |
| combined = map(lambda x: "".join(x), map(list, combos)) |
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 sum(a,b){ | |
| return a+b; | |
| } | |
| Array.prototype.min = function(){ | |
| return Math.min.apply(null, this); | |
| } | |
| function maxSlice(arr){ | |
| //Are there any negative numbers? If not, the entire array is the greatest segment. |