Skip to content

Instantly share code, notes, and snippets.

View jessefreeman's full-sized avatar

Jesse Freeman jessefreeman

View GitHub Profile
@jminor
jminor / a_star.js
Created February 15, 2011 17:49
A* path finding algorithm for impactjs game engine
// A* path finding algorithm for impactjs game engine
// adapted from http://stormhorse.com/a_star.js
// via http://46dogs.blogspot.com/2009/10/star-pathroute-finding-javascript-code.html
// impact-ified by jminor - http://pixelverse.org/
/* Example:
this.pathFinder = new PathFinder();
var start = [((this.pos.x+this.size.x/2) / tilesize).floor(), ((this.pos.y+this.size.y/2) / tilesize).floor()];
var destination = [((target.pos.x+target.size.x/2) / tilesize).floor(), ((target.pos.y+target.size.y/2) / tilesize).floor()];
@paularmstrong
paularmstrong / a_star.js
Created May 27, 2011 02:33 — forked from jminor/a_star.js
A* path finding algorithm for impactjs game engine
/**
* AStar
*
* Created by Paul Armstrong on 2011-05-26.
* Copyright (c) 2011 Paul Armstrong Designs. All rights reserved.
*
* Based on: https://gist.github.com/827899
*/
ig.module('plugins.a-star')
@zachstronaut
zachstronaut / gist:1184900
Created August 31, 2011 22:22
Stretch HTML5 canvas to fill window, preserving aspect ratio
/**
* fullscreenify()
* Stretch canvas to size of window.
*
* Zachary Johnson
* http://www.zachstronaut.com/
*
* See also: https://gist.github.com/1178522
*/
@phoboslab
phoboslab / touch-button.js
Last active August 10, 2021 14:44
Touch Button Plugin for Impact
ig.module(
'plugins.touch-button'
)
.requires(
'impact.system',
'impact.input',
'impact.image'
)
.defines(function(){ "use strict";
@jkosoy
jkosoy / gist:5379904
Last active June 20, 2023 14:06
Raspberry Pi setup

Raspberry Pi setup

Just wanted a quick start guide for myself so that I wouldn't have to keep rooting through Google to remember all this stuff. Hopefully it helps other people.

If you had other ideas or suggestions please leave a comment.

Useful things to own before you buy a Pi

The first time I bought a Pi I was enormously frustrated with myself because I didn't own all of this stuff. Kept having to order things off of Amazon and wait to get started... very irritating. This is all good stuff to have laying around anyway:

@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@sandrovicente
sandrovicente / remove-dotnet-cli-osx
Created July 3, 2016 21:37
Steps to uninstall a DotNet CLI version on Mac OS X
# delete the dotnet folder under /usr/local/share/dotnet
1. cd /usr/local/share/dotnet && ls
2. sudo rm -rf dotnet
# delete the dotnet reference file at /etc/paths.d/dotnet
1. cd /etc/paths.d && ls
2. sudo rm dotnet
@KeyMaster-
KeyMaster- / spriteGlitch.shader
Last active March 28, 2024 22:25
A glitch effect shader for Sprites in Unity3D
//Copyright (c) 2014 Tilman Schmidt (@KeyMaster_)
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in
@marceloCodget
marceloCodget / gist:3862929
Created October 10, 2012 03:05
RGB to Hex in Lua
-- passing a table like {255, 100, 20}
function application:rgbToHex(rgb)
local hexadecimal = '0X'
for key, value in pairs(rgb) do
local hex = ''
while(value > 0)do
local index = math.fmod(value, 16) + 1