This file contains hidden or 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
Array.prototype.unique = function () { return this.filter((e, i, a) => i === a.indexOf(e)) }; |
This file contains hidden or 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 sentencify(words) { | |
const str = words.join(' '); | |
return str[0].toUpperCase() + str.slice(1) + '.'; | |
} |
This file contains hidden or 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 orderFood(list) { | |
return list.reduce((a, {meal}) => ({...a, [meal]: a[meal] + 1 || 1}), {}); | |
} |
This file contains hidden or 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 countLanguages(list) { | |
return list.reduce((p, c) => { | |
if (p[c.language]) p[c.language] += 1 | |
else p[c.language] = 1; | |
return p; | |
}, {}) | |
} |
This file contains hidden or 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 spoonerize(words) { | |
output = new Array(); | |
let wordList = words.split(' '); | |
for (let i=0; i<wordList.length; i++) { | |
let myWord = wordList[i].replace(/^./, wordList[wordList.length - i - 1][0]); | |
output.push(myWord) | |
} | |
return output.join(' '); | |
} |
This file contains hidden or 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
local function just_print_it(text) | |
print(text) | |
end | |
local function print_it_backwards(text) | |
print(string.reverse(text)) | |
end | |
local function do_something(text, callback) | |
-- do neat stuff |
This file contains hidden or 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
sed -e 's/.*/> &/'| sed -e 's/.* to Everyone .*/\n&/' | pbcopy | |
# A cut-and-paste command. I'm using this then pasting the contents of a Zoom call chat | |
# The results are markdown-quoted messages with line breaks between each participant | |
# pbcopy is the Mac utility to capture to the clipboard. Linux & Windows may have different commands |
This file contains hidden or 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
echo "Paste in AWS_ACCESS_KEY_ID" && \ | |
read -s AWS_ACCESS_KEY_ID && \ | |
echo "Paste in AWS_SECRET_ACCESS_KEY" && \ | |
read -s AWS_SECRET_ACCESS_KEY && \ | |
export AWS_ACCESS_KEY_ID && \ | |
export AWS_SECRET_ACCESS_KEY && \ | |
echo "aws key ready for use" |
This file contains hidden or 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
a=math b=240 c=138 d=120 e=69 f=0 g=0 h=0 i=.5 j=.2 k=.5 | |
function l()m=d n=e o=0 p=0 q=0 r=0 end | |
l() | |
function TIC()t=a.sin(a.rad(f))u=-a.cos(a.rad(f))m=m+o n=n+p q=q+i r=r+j | |
if btnp(4)then m=d+t*9 n=e+u*9 o=t*2 p=u*2 end | |
if btn(2)then f=f-4 end | |
if btn(3)then f=f+4 end | |
cls()circ(d,e,7,8)print("*",(q-6)%b,(r-4)%c,6,true,2)circ(q%b,r%c,2,6) | |
if pix(m%b,n%c)==6 then g=g+1 k=k*1.2 i=k*t j=k*u l()end | |
print("SCORE "..g.." HI "..h,9,0)pix(m%b,n%c,15)line(d,e,d+t*9,e+u*9,15) |