Skip to content

Instantly share code, notes, and snippets.

@JarLowrey
JarLowrey / phaser_preloading_spritesheets_function_calls.bash
Last active April 7, 2016 15:36
Loop through all files in current directory. If ImageMagick thinks it is an image, output a preloading statement with that image's dimensions for the Phaser engine.
#!/bin/bash
echo $0 #this script requires ImageMagick, must be ran with bash
#copied from http://askubuntu.com/questions/179898/how-to-round-decimals-using-bc-in-bash
round()
{
echo $(printf %.f $(echo "scale=$2;(((10^$2)*$1)+0.5)/(10^$2)" | bc))
};
@JarLowrey
JarLowrey / update_rails_site.sh
Last active March 12, 2016 21:39
script to update rails website from a Git repo on a Digital Ocean 1-click Rails server
#!/bin/sh
echo $0
#go to UACT website directory
cd ~rails/UACT
#update repo
git pull origin master