Skip to content

Instantly share code, notes, and snippets.

View diiq's full-sized avatar

Sam Bleckley diiq

View GitHub Profile
/** Load 'er up! **/
$.ajax({url:url, dataType:"json", async:false, success:grid.mport});
grid.specials = {
//3:[{src:"baobad.png", x:66, y:2, offset:[-95, -287]}],
//3:[{src:"baobab.png", x:66, y:2, offset:[-110, -370]}]
//3:[{src:"clockwork.png", x:66, y:2, offset:[-50, -235]}]
};
var new_grid = function (url, callbacks) {
console.log(url);
var grid = {}, width, height;
grid.tilemap = unbrief_tilemap(save_squares["" + actor.x + actor.y].tilemap);
var save_squares = {};
var dingsave = function (actor) {
// A checkpoint; saves your game and goes 'ding'
if (actor.type === "player") {
grid.tiles[actor.x][actor.y].hash = "_";
if (!save_squares["" + actor.x + actor.y]){
save_squares["" + actor.x + actor.y] =
{color:actor.color, tilemap:brief_tilemap(grid.tilemap)};
}
transitions.push(function(){
var save_squares = {};
var dingsave = function (actor) {
// A checkpoint; saves your game and goes 'ding'
if (actor.type === "player") {
grid.tiles[actor.x][actor.y].hash = "_";
if (!save_squares["" + actor.x + actor.y]){
save_squares["" + actor.x + actor.y] =
{color:actor.color, tilemap:brief_tilemap(grid.tilemap)};
}
transitions.push(function(){
@diiq
diiq / snippet.html
Created April 30, 2015 22:52
Minimal Julian Clock
<script type="text/javascript">
function currentJulianDay() {
var epoch = 2440587.500000; // Jan. 1, 1970 00:00:00 UTC, Julian
var day = (new Date()).getTime() / 86400000 + epoch;
return day.toFixed(5);
}
function writeTime() {
document.getElementById("julian-clock").innerHTML = currentJulianDay();
}
@diiq
diiq / gist:43bf154a48e30ad7d625
Created April 24, 2015 22:32
baguettes error
2015-04-24 18:30:41.731 java[34728:8566463] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 7. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
2015-04-24 18:30:41.731 java[34728:8566463] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 7. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
Apr 24, 2015 6:30:41 PM net.java.games.input.DefaultControllerEnvironment getControllers
INFO: Loading: net.java.games.input.OSXEnvironmentPlugin
java.lang.UnsatisfiedLinkError: Can't load library: /Users/diiq/LudumEngine/natives/libjinput-osx.dylib
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at net.java.games.input.OSXEnvironmentPlugin$1.run(OSXEnvironmentPlugin.java:76)
at java.security.AccessController.doPrivileged(Native Method)
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(setq inhibit-startup-message t)
(setq site-lisp-dir
(expand-file-name "site-lisp" user-emacs-directory))
;; Set up load path
#!/bin/bash
# This script works in tandem with git-branch-with-scope. If you
# branched normally, this commits as usual. It should be saved in
# .git/hooks/prepare-commit-msg.
message_file="$1"
current_branch=`git symbolic-ref -q --short HEAD`
scope_definition=".git/$current_branch-scope"
#!/bin/bash
# Branches, but, like an antebellum father of a
# southern belle, it first demands a declaration
# of your intentions.
branch=$1
test -z $branch && echo "branch required." 1>&2 && exit 1
scope_template=".git/scope-template"