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 | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |
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 http = require('http'), | |
httpProxy = require('http-proxy'), | |
proxy = httpProxy.createProxyServer({}); | |
var url = require('url'); | |
http.createServer(function (req, res) { | |
var pathname = url.parse(req.url).pathname; | |
console.log('pathname', pathname); | |
var conversationsPath = '/api/conversations'; | |
var discoverPath = '/api/discover'; |
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
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
set show-all-if-ambiguous on | |
set completion-ignore-case on | |
[[ $- = *i* ]] && bind TAB:menu-complete |
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
If the forward-delete key just keeps inputting a '~' when pressed, instead of deleting the next character there is an easy solution. | |
In Terminal Preferences, click `profiles > Keyboard and + (Add)` | |
Double-click on the `del (forward delete)` key. | |
In the window that pops open, in the input box just below "Action."Type: | |
`Control-Option-D` | |
you should see '\004' in the box. Click OK, close the Terminal Inpsector window, and you should now have a working forward-delete key. | |
Yay! |
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 localStorageToJSON = function localStorageToJSONFn(obj){ | |
var storage = {}; | |
for(var item in obj){ | |
try{ | |
json = JSON.parse(obj[item]); | |
storage[item] = json; | |
} catch(err){ | |
storage[item] = obj[item] | |
} | |
} |
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
<style> | |
.input-symbol{ | |
position:relative; | |
} | |
.input-symbol span{ | |
position: absolute; | |
transform: translate(0,-50%); | |
top:50%; | |
pointer-events:none; |
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
#!/usr/bin/python | |
# src: http://apple.stackexchange.com/questions/4286/is-there-a-mac-os-x-terminal-version-of-the-free-command-in-linux-systems | |
import subprocess | |
import re | |
# Get process info | |
ps = subprocess.Popen(['ps', '-caxm', '-orss,comm'], stdout=subprocess.PIPE).communicate()[0] | |
vm = subprocess.Popen(['vm_stat'], stdout=subprocess.PIPE).communicate()[0] | |
# Iterate processes |
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
[alias] | |
ca = !sh -c 'git add -A && git commit -m \"$1\"' |
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
// | |
/** | |
* Returns the inverse of the standard normal cumulative distribution. | |
* The distribution has a mean of zero and a standard deviation of one. | |
* Based on: https://github.com/liorzoue/js-normal-inverse | |
* @param Number | |
*/ | |
function normsInv(x){ | |
if(isNaN(x)){ | |
throw new TypeError('normsInv requires a parameter of type Number'); |
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
/** | |
* Allows us to referece files relative to our JS_DIR wthing our imports uing '~' | |
* | |
* e.g. '~/main.js' would import the file JS_DIR +'/main.js' | |
*/ | |
var Path = require('path') | |
var JS_DIR = '/app/js'; | |
/* | |
// For referece : Babel 5 version | |
module.exports = function (babel) { |
OlderNewer