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
FROM amazonlinux | |
RUN curl -O https://nodejs.org/dist/v4.3.0/node-v4.3.0-linux-x64.tar.gz | |
RUN tar --strip-components 1 -xzvf node-v* -C /usr/local | |
RUN rm node-v4.3.0-linux-x64.tar.gz | |
CMD ["/bin/bash"] |
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
'use strict'; | |
function Queue() { | |
return { | |
entries: [], | |
enqueue(value) { | |
this.entries.push(value); | |
}, | |
dequeue() { | |
return this.entries.shift(); |
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
{ | |
question: { | |
questionId: '', | |
response: [ | |
// HISTORICAL | |
{ | |
score: '' | |
answerId: '' | |
}, | |
{ |
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
// an array of strings mangled with this function will sort | |
// backwards. You can then mangle them again after the sorting | |
// to get your original words. of course, you could just do sort().reverse(), but | |
// I was curious. So, completely useless. | |
const maxUnicodeValue = 0x10FFFF; | |
function invertString(input) { | |
let result = ''; | |
for(let c of input) { | |
const oldCode = c.codePointAt(0); |
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
pgsql_execfile () { | |
clear | |
echo "\n" | |
tmpfile="$(mktemp).html" | |
nodemon --exec "psql -U postgres -h localhost -p 5433 -d $1 -f $2 --html -- > $tmpfile && w3m -dump $tmpfile && echo " $2 | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ | |
unsigned long int fib(unsigned long int x); | |
char *ptr; | |
unsigned long int input = strtoul(argv[1], &ptr, 10); | |
unsigned long int result = fib(input); | |
printf("result: %lu\n", result); |
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 pwdx { | |
# note: NF is the number of columns, so $NF gives us the last column | |
lsof -a -p $1 -d cwd -n | tail -1 | awk '{print $1, "\t", $NF}' | |
} | |
function portpwdx { | |
# pid=$(lsof -i :5858 | tail -1 | perl -pe 's/[^\s]+\s+([^\s]+)\s.*/$1/') | |
pid=$(lsof -i :$1 | tail -1 | perl -pe 's/[^\s]+\s+([^\s]+)\s.*/$1/') | |
if [[ ! -z $pid ]]; then | |
echo $pid |
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
const delimiterMap = { | |
'[': ']', | |
'(': ')', | |
'<': '>', | |
}; | |
function getArgumentsArray(input) { | |
let current = ''; | |
const result = []; | |
let delimiterEnd; |
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
#! /bin/zsh | |
DEFAULT_WARNING="WARNING: in simulation mode so not modifying filesystem." | |
for folder in */; do | |
# for folder in */; do | |
echo "- ${folder}"; | |
# capture stderr, but send stdout to /dev/tty like normal | |
output="$(stow -n -v ${folder} 2>&1)" |
NewerOlder