This file contains 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
// Serach for SANDRA across multiple tables and columns | |
SELECT * FROM ( | |
SELECT *, | |
( | |
CASE | |
WHEN first_name LIKE '%SANDRA%' THEN 1 | |
ELSE 0 | |
END | |
) AS match_strength | |
FROM actor |
This file contains 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
netstat -vanp tcp | grep 7203 <--- Port Number | |
Kill -9 7203 |
This file contains 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
open -n -a /Applications/Google\ Chrome.app --args --user-data-dir="/tmp/someFolderName" --disable-web-security |
This file contains 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
export const PROPtoCSS = (props) => { | |
if(Object.keys(props).length==0) return {} | |
const css ={} | |
for(let propName in props){ | |
const chars = propName.split(/([A-Z])/g) | |
const names = chars.map((v, i, arr)=>{ | |
if(v.match(/[A-Z]/)){ | |
arr[i+1] = `${v.toLowerCase()}${arr[i+1]}` | |
} |
This file contains 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
const Right = x => | |
({ | |
map: f => Right(f(x)), | |
fold: (f,g) => g(x), | |
inspect: f => f(`Right(${x})`) | |
}) | |
const Left = x => | |
({ |
This file contains 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
const memoize = (fn) => { | |
const cache = {} | |
return (...args) => { | |
const key = args.toString() | |
if(cache[key] == undefined){ | |
cache[key] = fn(...args) | |
} | |
return cache[key] |
This file contains 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
function* gen(){ | |
var rand = _.random(1000,5000); | |
return ()=>{ | |
return setTimeout(()=>{ | |
console.log('hi'); | |
console.log(rand); | |
return gen().next().value(); | |
}, rand) | |
} | |
} |