Skip to content

Instantly share code, notes, and snippets.

@jakeklassen
jakeklassen / game.js
Last active June 13, 2020 01:20
Breakout game
// @ts-check
const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
// Utility Functions
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
// https://developer.mozilla.org/kab/docs/Games/Techniques/2D_collision_detection

Keybase proof

I hereby claim:

  • I am jakeklassen on github.
  • I am jakeklassen (https://keybase.io/jakeklassen) on keybase.
  • I have a public key whose fingerprint is 8F2E 2740 EDB6 4AB9 BFEA 928A 09B4 5718 1311 91FD

To claim this, I am signing this object:

@jakeklassen
jakeklassen / cloud-init-dokku-post.yaml
Last active December 10, 2017 10:06
Digital Ocean cloud-config script for Ubuntu 16
#cloud-config
# Configures a basic Ubuntu box.
# * Installs a few common packages
# * Disables root login
# * Disables password login
# * Creates a user in the sudo, www-data groups
#
# Follow the log by ssh-ing in and running: `tail -f /var/log/cloud-init-output.log`
apt_update: true
apt_upgrade: true
@jakeklassen
jakeklassen / README.md
Last active May 4, 2016 18:46
Template tags for base directory path importing.
@jakeklassen
jakeklassen / clone.sh
Last active January 7, 2016 16:32
Clone repo into non-empty folder
# http://stackoverflow.com/questions/9864728/how-to-get-git-to-clone-into-current-directory
git clone your-repo tmp && mv tmp/.git . && rm -rf tmp && git reset --hard
@jakeklassen
jakeklassen / interview.js
Last active August 29, 2015 14:16
Some JavaScript questions.
/* jshint ignore:start */
// Complete the questions below and save the file as first-last.js
// Question 1.
// Looking at the loop below, we expect the output to be 0 through 4. However,
// the loop below will output the value "5" five times. Fix it.
for (var i = 0; i < 5; ++i) {
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"