Skip to content

Instantly share code, notes, and snippets.

View KraigWalker's full-sized avatar

Kraig Walker KraigWalker

View GitHub Profile
@KraigWalker
KraigWalker / gist:2126867
Created March 19, 2012 20:32
Creating a Release Branch
$ git checkout -b release-VERSIONNUMBER develop
$ ./bump-version.sh VERSIONNUMBER
$ git commit -a -m "Bumped version number to VERSIONNUMBER"
@KraigWalker
KraigWalker / app.js
Created April 28, 2013 12:52
Display Remaining Characters Available in a Text Area
// Listen for events on the Feedback Text Area
jQuery(document).ready(function($) {
updateCountdown();
$('.message').change(updateCountdown);
$('.message').keyup(updateCountdown)
});
// Display the number of remaining characters in the Feedback Text Area
function updateCountdown() {
// Max number of characters 2500
@KraigWalker
KraigWalker / CameraController.cs
Last active December 25, 2015 04:49
Positions an isometric camera in the scene and updates it's location according to keyboard input. For the tutorial on how to create an isometric game camera visit http://bit.ly/19D0D9E
using UnityEngine;
using System.Collections;
// Camera Controller
// Revision 2
// Allows the camera to move left, right, up and down along a fixed axis.
// Attach to a camera GameObject (e.g MainCamera) for functionality.
public class CameraController : MonoBehaviour {
@KraigWalker
KraigWalker / CameraController.cs
Created October 19, 2013 15:09
not a final script
public class CameraController : MonoBehaviour {
public bool useCInput = false; // whether or not to use cInput 2.x
public Transform focusTarget; // we look at and follow this
[HideInInspector]
// How fast the camera moves
public int cameraVelocity = 10;
@KraigWalker
KraigWalker / fadeOpacity.js
Last active August 29, 2015 14:02
Famo.us - Fade in a Renderable's Opacity with a Quick Utility Function
/**
* Utility function that allows for the quick creation of a StateModifier to modifiy the opacity of a renderable
*
* @param {!number} startOpacity The initial opacity of the object at the start of the transition (0-1)
* @param {!number} endOpacity The final opacity of the object at the end of the transition (0-1)
* @param {Transition} transition The curve function and duration that affects the opacity
* @param {function} callback Callback function after the transition
* @return {StateModifier}
*
* @example
@KraigWalker
KraigWalker / git-nuke
Created July 14, 2014 06:56
git-nuke
#!/bin/sh
#
# Nukes a branch locally and on the origin remote.
#
# $1 - Branch name.
#
# Examples
#
# git nuke add-git-nuke
@KraigWalker
KraigWalker / FlexGrid.js
Created October 24, 2014 12:45
Famo.us FlexGrid Component
define(function, exports, module) {
var View = require('famous/core/View');
var Entity = require('famous/core/Entity');
var Modifier = require('famous/core/Modifier');
var Transform = require('famous/core/Transform');
var Transitionable = require('famous/transitions/Transitionable');
var TransitionableTransform = require('famous/transitions/TransitionableTransform');
function FlexGrid() {
View.apply(this, arguments);
@KraigWalker
KraigWalker / t.js
Created June 7, 2015 08:45
Tweet Sized JavaScript Templating Library to Eliminate String Concatenation
// Props to Thomas Fuchs ;)
// usage:
// var options = {
// id: SiteLink
// href: https://kraigwalker.com
//}
// return t('<a href="{href}" id="{id}"></a>', options);
function t(s, d) {
for(var p in d)
@KraigWalker
KraigWalker / gri.sh
Created September 8, 2015 15:00
Untrack any existing files that you've added to your .gitignore
# put this in your .bashrc/.zshrc file
alias gri="git ls-files --ignored --exclude-standard | xargs git rm"