Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am shioju on github.
  • I am shenghau (https://keybase.io/shenghau) on keybase.
  • I have a public key ASBseeafZmNx045OQzVQeo4y0c9_Ix2sDbvZQR99iVDZqAo

To claim this, I am signing this object:

@shioju
shioju / buttify.js
Last active April 9, 2018 15:11
Tagged Template Literals
const buttify = (strings, ...values) => {
return strings.map((str, i) => {
return typeof values[i] === "undefined" ? str : str + values[i]
}).join("").replace("cloud", "butt")
}
const adjective = "awesome"
buttify`Gcloud is ${adjective}`
//Gbutt is awesome
@shioju
shioju / makethisbig.js
Created April 9, 2018 15:09
makethisbig.js
const takeFunctions = (strings, func) => {
return func(strings);
}
takeFunctions`make this big${(strings) => strings.join("").toUpperCase()}`
// "MAKE THIS BIG"
@shioju
shioju / unbutt.js
Created April 9, 2018 15:06
unbutt.js
const unbutt = (buzzwords) => {
const words = buzzwords.join('').split(',')
return (sentence) => {
for (word of words) {
sentence = sentence.replace(new RegExp(word, 'g'), 'butt')
}
return sentence;
}
}