Skip to content

Instantly share code, notes, and snippets.

View kahwee's full-sized avatar
🎯
Focusing

KahWee Teng kahwee

🎯
Focusing
  • Uber Technologies
  • San Francisco, CA
View GitHub Profile
@kahwee
kahwee / like-linkedin.js
Created August 9, 2018 11:01
On days I can't decide, I like everything in LinkedIn
[...$('.like-button:not(.active)')].forEach(el => el.click())
@kahwee
kahwee / basic-hello.js
Created September 24, 2017 07:14
sayHello()
const chalk = require('chalk')
/*
( Open parantheses
) Close parantheses
[ Open bracket
] Close bracket
{ Open brace
} Close brace
/ (Forward) Slash
# Install iTerm https://www.iterm2.com/downloads.html (Stable release)
# Open and install and run this:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Then install git
brew install git
# Then run this:
brew install node
cd && mkdir .node_modules_global
npm config set prefix=$HOME/.node_modules_global
echo 'Remember to do this: export PATH="$HOME/.node_modules_global/bin:$PATH"'
@kahwee
kahwee / steps.md
Created July 26, 2016 03:12
Steps problems question

Given n being the number of steps, how many ways can you climb the stairs if you can step 1, 2 or 3 steps at a time.

0: []
1: [1]
2: [1, 1], 
   [2]
3: [1, 1, 1], 
   [2, 1], 
 [1, 2], 
@kahwee
kahwee / keybase.md
Created June 1, 2016 19:36
keybase.md

Keybase proof

I hereby claim:

  • I am kahwee on github.
  • I am kahwee (https://keybase.io/kahwee) on keybase.
  • I have a public key whose fingerprint is 1D47 5A2C 86C3 3DC0 3E61 5F8C 903D 82B0 F5D1 66FB

To claim this, I am signing this object:

function reverse (string) {
return string.split('').reverse().join('')
}
function largerHexxeh (kAsString) {
var len = kAsString.length
var k10 = parseInt(kAsString, 16)
var firstHalf = kAsString.slice(0, Math.ceil(len / 2))
var firstHalfInt = parseInt(firstHalf, 16)
var firstHalfA = firstHalfInt.toString(16)
@kahwee
kahwee / moatvideo.js
Last active January 6, 2016 21:32
Sample of moatvideo.js
/*Copyright (c) 2011-2015 Moat Inc. All Rights Reserved.*/
try{(function(w,v){var s={},M,za,Aa,ga=0,aa={},ha=[],z={},W=[],x={},U=!1,Ia={15:"",12:"",6:"",7:""},Ba,Ja=function(){for(var a=0;a<ha.length;a++)window.clearTimeout(ha[a]);for(a=0;a<W.length;a++)window.clearInterval(W[a]);for(var h in z)z.hasOwnProperty&&z.hasOwnProperty(h)&&z[h]&&(window.clearTimeout(z[h].tid),z[h]=!1);ha=[];W=[]},P=function(){for(var a in x)if(x.hasOwnProperty(a)){var h=x[a];s.a.a(h);s.b.a(h)}Ja()};s.c=P;(function(a){function h(a){var m=new RegExp("(^| )"+a+"($| )");return function(a){return a&&
a.className&&a.className.match(m)}}function r(a){return a&&a.document&&a.location&&a[k+l]&&a[u+t]}function e(a){if(null==a||r(a))return!1;var m=a.length;return 1===a.nodeType&&m?!0:"string"===typeof a||d(a)||0===m||"number"===typeof m&&0<m&&m-1 in a}function d(c){return"[object Array]"===a.d.bf.toString.call(c)}a.d={};a.d.a=3E3;a.d.b=function(){var a=/Firefox\/(\d+)/.exec(navigator.userAgent);return a?(a=parseInt(a[1],10),21>a&&14<a):!1}();a
var template2 = Handlebars.compile('{{#each company}}{{#each employee}}{{@key}}{{@../index}}\n{{this}}\n\n{{/each}}{{/each}}');
/*
Return--
Tremor Video0
X
Tremor Video0
Y
Microsoft1