Skip to content

Instantly share code, notes, and snippets.

View leogau's full-sized avatar
🥳

Leo Gau leogau

🥳
View GitHub Profile
! Superhuman "read receipt" tracking pixel
||media.superhumanapp.com/images/_/*://r.superhuman.com/*.gif$image
||r.superhuman.com/*.gif$document
! hunter.io email tracking
! https://mailtracker.hunter.io/articles/how-does-email-tracking-work
||mltrk.io/pixel/*^$document
||media.superhumanapp.com/images/_/*://*.mltrk.io/pixel/*^$image
! SendGrid email tracking

Keybase proof

I hereby claim:

  • I am leogau on github.
  • I am leogau (https://keybase.io/leogau) on keybase.
  • I have a public key ASDnQOGf0nuu70ifGHWRZ4q3wmiLy2WF68JMk-mYtyO_EAo

To claim this, I am signing this object:

@leogau
leogau / tap-example-2.js
Created March 22, 2016 15:31
Underscore tap example 2
var sortedStooges = _.chain(stooges)
.sortBy(function(stooge){ return stooge[SORT_BY_KEY]; })
.tap(function(o) { console.log(JSON.stringify(o)) })
.map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
.first()
.value();
// Output from _.tap function
// => [{"name":"curly","age":25},{"name":"moe","age":21},{"name":"larry","age":23}]
@leogau
leogau / tap-example-1.js
Created March 22, 2016 15:29
Underscore tap example #1
var sortedStooges = _.chain(stooges)
.tap(function(o) { console.log(JSON.stringify(o)) })
.sortBy(function(stooge){ return stooge[SORT_BY_KEY]; })
.map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
.first()
.value();
// Output from _.tap function
// => [{"name":"curly","age":25},{"name":"moe","age":21},{"name":"larry","age":23}]
@leogau
leogau / chain-bug.js
Last active March 22, 2016 15:26
Underscore chain bug
var stooges = [{name: 'curly', age: 25}, {name: 'moe', age: 21}, {name: 'larry', age: 23}];
var SORT_BY_KEY = ‘aeg’;
var sortedStooges = _.chain(stooges)
.sortBy(function(stooge){ return stooge[SORT_BY_KEY]; })
.map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
.first()
.value();
console.log(sortedStooges) // => "curly is 25"
@leogau
leogau / chain.js
Last active March 22, 2016 15:20
Underscore chain example
var output = _.chain([3, 2, 1])
.tail()
.sort()
.value()
console.log(output); // => [1, 2]