Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am thomblake on github.
  • I am thomblake (https://keybase.io/thomblake) on keybase.
  • I have a public key whose fingerprint is E766 FE1F 6C93 81E5 5B08 D875 4193 DABC 127E 7585

To claim this, I am signing this object:

@tamzinblake
tamzinblake / git_blame.sh
Created October 2, 2014 02:39
How to find lines of code by a particular author
for i in `git ls-tree -r master --name-only`; do [[ -n $(git blame $i | grep 'TJ Koblentz') ]] && echo $i; git blame $i | grep 'TJ Koblentz'; done | less -S
@tamzinblake
tamzinblake / cascadia_professional_ethics.md
Last active August 29, 2015 14:16
CascadiaJS Professional Ethics Talk Proposal
@tamzinblake
tamzinblake / gist:d7bcbd10e63950d70ae9
Last active August 29, 2015 14:19
+ at the beginning of a line problematically
var a = foo()
+b
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8080, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8080/');
@tamzinblake
tamzinblake / regex_end_of_string.md
Created May 27, 2011 15:37
Javascript regex grammar quirk

This gist regards some confusion resulting from this StackOverflow question.

Refer to sections 15.5.4.10 and 15.5.4.11 of the spec - page 145ish.

Before any passes, the cursor is at the start of the string:

, " , f , o , o ,   , b , a , r , " ,
^

lastIndex = 0
@tamzinblake
tamzinblake / js2-mode-npm.md
Created June 1, 2011 20:54
Improved js2-mode for npm style
@tamzinblake
tamzinblake / errors.js
Created June 7, 2011 20:53
How errors pop out in my js-mode
// Showing how errors pop out in my js-mode standard indenting:
// (https://github.com/thomblake/js-mode)
// (courtesy of https://gist.github.com/357981 for the excellent examples)
// error in standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog"
e = "elf",
@tamzinblake
tamzinblake / comma.js
Created June 13, 2011 17:54
alternate comma-first style
//an alternate comma-first style soon to be supported by my js-mode
//The assumption is that you will consistently not put the first item in the
//list on the same line as the brace, and then want the commas / operators
//2 spaces back from there.
//normal cases:
var test = {
prop1: "value1"
@tamzinblake
tamzinblake / quantum_weirdness.el
Created June 16, 2011 16:46
perl quantum weirdness explained
;;;This gist refers to the problem referenced at http://www.perlmonks.org/?node_id=369247
;;;written in lispy format for clarity; the following is not necessarily valid lisp
;;;m is a variable currently equal to 20
;;;expression to be evaluated: (++m + m++)
;;;pretend pre-increment and post-increment exist in lisp - then, this is the expression:
(+ (++m) (m++)) ; m = 20
;;; `preincrement' increments the variable and returns the variable
(+ m (m++)) ; m = 21
;;; the following line is the magic - replace `postincrement' with `increment, then return original value'