As configured in my dotfiles.
start new:
tmux
start new with session name:
// Place user-specific overrides in this file, to ensure they're preserved | |
// when upgrading | |
{ | |
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"] | |
} |
As configured in my dotfiles.
start new:
tmux
start new with session name:
function saveContact( row ){ | |
var form = $.tmpl(templates["contact-form"]), | |
valid = true, | |
messages = [], | |
dfd = $.Deferred(); | |
/* | |
bunch of client-side validation here | |
*/ | |
.note { | |
position:relative; | |
width:30%; | |
padding:1em 1.5em; | |
margin:2em auto; | |
color:#fff; | |
background:#97C02F; | |
overflow:hidden; | |
} |
/* Polyfill indexOf. */ | |
var indexOf; | |
if (typeof Array.prototype.indexOf === 'function') { | |
indexOf = function (haystack, needle) { | |
return haystack.indexOf(needle); | |
}; | |
} else { | |
indexOf = function (haystack, needle) { | |
var i = 0, length = haystack.length, idx = -1, found = false; |
git
discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
from collections import defaultdict | |
from heapq import * | |
def dijkstra(edges, f, t): | |
g = defaultdict(list) | |
for l,r,c in edges: | |
g[l].append((c,r)) | |
q, seen, mins = [(0,f,())], set(), {f: 0} | |
while q: |
import "bytes" | |
func StreamToByte(stream io.Reader) []byte { | |
buf := new(bytes.Buffer) | |
buf.ReadFrom(stream) | |
return buf.Bytes() | |
} | |
func StreamToString(stream io.Reader) string { | |
buf := new(bytes.Buffer) |
##what are generators##
yield
a value, the function pauses until .next(modifiedYieldValue)
is calledvar myGen = function*() {
var one = yield 1;
var two = yield 2;
var three = yield 3;
console.log(one, two, three);
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
type test_struct struct { | |
Test string |