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
➜ lovecraft git:(master) make up | |
docker-compose -p lovecraft -f docker-compose.yml up -d proxy | |
Traceback (most recent call last): | |
File "<string>", line 3, in <module> | |
File "/compose/compose/cli/main.py", line 55, in main | |
File "/compose/compose/cli/docopt_command.py", line 23, in sys_dispatch | |
File "/compose/compose/cli/docopt_command.py", line 26, in dispatch | |
File "/compose/compose/cli/main.py", line 172, in perform_command | |
File "/compose/compose/cli/command.py", line 52, in project_from_options | |
File "/compose/compose/cli/command.py", line 87, in get_project |
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/bash | |
DYNAMODB_USER=vagrant | |
sudo apt-get install openjdk-7-jre-headless -y | |
cd /home/${DYNAMODB_USER}/ | |
mkdir -p dynamodb | |
cd dynamodb |
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
There are 2 possibilities I can think of to organise the data cleanly. | |
Option 1) | |
* Have 2 JSON objects. | |
* One that is just a map between the salad name and the id. We can then pass ids from the form to the calculator functions. | |
* The other json object contains all the actual data. | |
E.g.: | |
{ |
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
Website only has kilojoule/calorie info so that's all we'll render I guess. Maybe I can estimate the protein... | |
Mock data: | |
POST /api/v1/nutrition/salad | |
{ | |
"size": "small", | |
"data": [ | |
{ | |
"id": "chicken_pasta", |
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
The paperclips game over at www.decisionproblem.com/paperclips/index2.html is great, but if you want to play the game indefinitely you can lose all progress if you clear browser cache or change laptop. | |
I wanted a way to create a save file and load it later, so I did. Use the below script to generate the output to load the current game state. | |
var saveGame=localStorage.getItem("saveGame"),savePrestige=localStorage.getItem("savePrestige"),saveProjectsActive=localStorage.getItem("saveProjectsActive"),saveProjectsFlags=localStorage.getItem("saveProjectsFlags"),saveProjectsUses=localStorage.getItem("saveProjectsUses"),saveStratsActive=localStorage.getItem("saveStratsActive"),restoreString="/************* COPY ALL TEXT BELOW THIS LINE AND SAVE IN A TEXTFILE SOMEWHERE. RUN IT IN ANY CHROME OR FIREFOX CONSOLE TO LOAD IT. *************/\nlocalStorage.setItem('saveGame', '"+saveGame+"') \nlocalStorage.setItem('savePrestige', '"+savePrestige+"') \nlocalStorage.setItem('saveProjectsActive', '"+saveProjectsActive+"') |
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 gitu { | |
BRANCH=${1:-master} | |
echo "Checking out $BRANCH" | |
git checkout "$BRANCH" && git fetch origin && git merge --ff-only origin/"$BRANCH" | |
} |
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
f, err := os.Create("cpu.trace") | |
if err != nil { | |
panic(err) | |
} | |
trace.Start(f) | |
defer trace.Stop() |
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
redis-cli KEYS "PREFIX*" | xargs -L 100 redis-cli DEL |
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
start := time.Now() | |
/* | |
var buffer bytes.Buffer | |
for _, x := range v { | |
buffer.WriteString(x) | |
buffer.WriteString("::") | |
} | |
test := strings.ToLower(buffer.String()) */ |
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
//Gzip will take an uncompressed bytestream and gzip it | |
func Gzip(unzip []byte) []byte { | |
var zip bytes.Buffer | |
gz := gzip.NewWriter(&zip) | |
if _, err := gz.Write(unzip); err != nil { | |
panic(err) | |
} | |
if err := gz.Flush(); err != nil { | |
panic(err) | |
} |
OlderNewer