Skip to content

Instantly share code, notes, and snippets.

@shawngmc
shawngmc / _.md
Created February 22, 2016 20:04
test
@shawngmc
shawngmc / gist:4b735c664dc8fee4a878
Created March 17, 2016 05:08 — forked from garthvh/gist:07805317032ce7d55887
Chromebook Crouton Setup

These are notes for myself on the crouton setup for my chromebook

1. Enter Developer Mode

Hold Power+ESC+Refresh, then let go of the power, when the OS verification warning screen appears enter Ctrl-D

2. Setup Crouton

Follow the instructions here to download the latest version of https://goo.gl/fd3zc.

@shawngmc
shawngmc / incremental_game_optimization.md
Last active November 25, 2021 09:31
Incremental Game Optimization in JS

Incremental games are great - they can also be fun to write - but making one that's truly a keeper requires careful design. I've dropped too many games because they peg my PC or are throttled, and as a developer I know it's avoidable. So - let's discuss it!

Background tab throttling / document focus

One of the first things to keep in mind is that your game should behave differently if it is not in the foreground. Why? As a protective measure, web browsers limit the activity of background tabs:

Managing Display Updates

Why?

@shawngmc
shawngmc / wget.txt
Created December 22, 2017 00:49
Wiki.js Docker Container - Not responding
user@dockermachine:~/$ wget http://localhost:3000/
--2017-12-21 19:35:39-- http://localhost:3000/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:3000... connected.
HTTP request sent, awaiting response... 302 Found
Location: /login [following]
--2017-12-21 19:37:39-- http://localhost:3000/login
Connecting to localhost (localhost)|::1|:3000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
@shawngmc
shawngmc / wikijs_config.txt
Created December 22, 2017 00:56
Wiki.js docker command & basic config
# Docker command to start it
docker run -d \
-p 3000:3000 \
-v /localdir/on/mybox/wikijs/config.yml:/var/wiki/config.yml \
-e "[email protected]" \
-e "VIRTUAL_HOST=wiki.mysite.com" \
-e "LETSENCRYPT_HOST=wiki.mysite.com" \
-e "[email protected]" \
--name wikijs \
requarks/wiki
@shawngmc
shawngmc / logs.txt
Created December 22, 2017 02:33
Wiki.js - Exception when running
--------------------------
Container Logs
--------------------------
2017-12-22 00:31:34,716 CRIT Supervisor running as root (no user in config file)
2017-12-22 00:31:34,723 INFO RPC interface 'supervisor' initialized
2017-12-22 00:31:34,723 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-12-22 00:31:34,723 INFO supervisord started with pid 1
2017-12-22 00:31:35,725 INFO spawned: 'wikijs' with pid 9
2017-12-22 00:31:37,309 INFO success: wikijs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
# Install mailutils for email access
sudo apt-get install mailutils
# Install prereqs for dpkg over https
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
@shawngmc
shawngmc / guacamole_setup.sh
Created December 3, 2018 18:07
Guacamole Docker Setup
. .env
# Used from .env
# PASSWD: The postgres password
# Set up Guacd
echo Creating guacd container...
docker run -d \
--name guacd \
guacamole/guacd
@shawngmc
shawngmc / crostini-dev-container.sh
Last active February 9, 2019 05:51
Setup Script for a decent Crostini web dev env
# Update Clock
# https://www.reddit.com/r/Crostini/wiki/getstarted/bootstrapping-a-container
sudo dpkg-reconfigure tzdata
# Update package list
sudo apt-get update -y
sudo apt-get upgrade -y
# Install 'command-not-found' support
# https://www.reddit.com/r/Crostini/wiki/howto/install-command-not-found
##########
# Dev Stuff
##########
# Git and GitFlow
brew install git
brew install git-flow