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/bash | |
synclient VertTwoFingerScroll=1 | |
synclient TapButton1=1 | |
synclient TapButton2=3 | |
synclient TapButton3=2 | |
synclient VertScrollDelta=-243 |
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 ( | |
"fmt" | |
"regexp" | |
"strconv" | |
"testing" | |
) | |
func BenchmarkFmt(b *testing.B) { | |
url := "/client/11/merchants" | |
pattern := "/client/%d/merchants" |
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
(ns Foo | |
(:gen-class)) | |
(defn tick [[queue rung1 rung2 rung3]] | |
(let [ball (first queue) queue (rest queue)] | |
(if (not= (count rung1) 4) | |
[queue (cons ball rung1) rung2 rung3] | |
(let [queue (concat queue rung1) rung1 ()] |
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
CREATE TABLE timeline ( | |
mid int, | |
uid text, | |
ts timestamp, | |
PRIMARY KEY ((mid, uid), ts) | |
) | |
// query is | |
select ts from timeline where mid=? and uid=? and ts >= ? |
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
type ProfileFetcher struct { | |
Session interface { | |
Query(string, ...interface{}) interface { | |
Iter() Scanner | |
} | |
} | |
Duration time.Duration | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
struct List { | |
struct List *next; | |
}; | |
int main(int argc, char **argv) { | |
struct List *l = malloc(sizeof (struct List)); | |
l->next = l; | |
int 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
struct List { | |
next: Option<Box<List>> | |
} | |
fn main() { | |
let mut l = Some(box List{next: None}); | |
for _ in range(0, 156751200) { | |
l = match l { | |
Some(l) => l.next, | |
None => None | |
} |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"github.com/davecheney/profile" | |
"os" | |
"strings" | |
) |
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
(pprof) top10 | |
Total: 174 samples | |
44 25.3% 25.3% 78 44.8% strings.genSplit | |
33 19.0% 44.3% 33 19.0% strings.Count | |
25 14.4% 58.6% 25 14.4% runtime.aeshashbody | |
21 12.1% 70.7% 21 12.1% markonly | |
13 7.5% 78.2% 16 9.2% MCentral_Grow | |
11 6.3% 84.5% 12 6.9% syscall.Syscall | |
7 4.0% 88.5% 7 4.0% runtime.indexbytebody | |
4 2.3% 90.8% 4 2.3% scanblock |
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
nil = None | |
def goify(f): | |
""" | |
You know why | |
""" | |
@functools.wraps(f) | |
def wrapper(*args, **kwargs): | |
""" | |
Wrap wrap a function that can return an error | |
in a tuple of (result, error) |