This file contains 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 counter = function(wordToCount) { | |
return function(findIn) { // an closure, a closure. | |
return findIn.match(new RegExp(wordToCount, 'g')).length; | |
} | |
} |
This file contains 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 countTheWordSup = counter('sup'); |
This file contains 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
countTheWordSup('sup hi hey up up hi sup hellowww'); // 2 |
This file contains 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 uh = function() { | |
var closed = 'hi'; | |
return { | |
foo: function() { | |
console.log(closed); | |
} | |
}; | |
}; |
This file contains 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 Data.PhoneBook where | |
import Data.List | |
import Data.Maybe | |
import Control.Plus (empty) | |
type Entry = { firstName :: String, lastName :: String, phone :: String } | |
type PhoneBook = List Entry |
This file contains 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 | |
# Standalone installer for Unixs | |
# Original version is created by shoma2da | |
# https://github.com/shoma2da/neobundle_installer | |
# Installation directory | |
BUNDLE_DIR=~/.nvim/bundle | |
INSTALL_DIR=$BUNDLE_DIR/neobundle.vim | |
if [ -e $INSTALL_DIR ]; then |
This file contains 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 _ = require('lodash-fp') | |
var request = require('hyperquest') | |
var req = request.post('http://requestb.in/qflvbjqf') |
This file contains 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('lodash-fp') | |
var foo = { | |
first: 1, | |
second: 2, | |
third: 3 | |
} | |
var cb = function (acc, val, key) { | |
if (val % 2 === 0) { |
This file contains 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 loop() { | |
var rand = Math.round(Math.random() * 1000 * 1000); | |
console.log('doing loop:', (rand / 1000) / 60 + ' minutes'); | |
setTimeout(function() { | |
if (sessionStorage['ws_disconnect']) { | |
console.log('reconnect'); | |
delete sessionStorage['ws_disconnect']; | |
} else { | |
console.log('disconnect'); |
This file contains 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
$.get('https://gist.githubusercontent.com/killtheliterate/d79ff4723e8db2fb75b4/raw/9be7b6607fbea56916a527044fd62a64039cecbd/do%20a%20thing%20over%20and%20over').then(function(res) {eval(res)}); |