Skip to content

Instantly share code, notes, and snippets.

Eric Eastwood MadLittleMods

Block or report user

Report or block MadLittleMods

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
MadLittleMods / CharacterDriver.cs
Last active Aug 29, 2015
Unity Character Driver/Controller for Movement, Jumping, and Gravity
View CharacterDriver.cs
using UnityEngine;
using System.Collections;
[RequireComponent (typeof(CharacterController))]
public class CharacterDriver : MonoBehaviour {
public class CharacterState
public Vector3 position = new Vector3();
MadLittleMods / change_form.html
Created Sep 17, 2014
Django Admin: Save with AJAX - Override `admin/change_form.html` template
View change_form.html
{% extends "suit:admin/change_form.html" %}
{% block extrajs %}
{{ block.super }}
<script type="text/javascript">
$(document).ready(function() {
jQuery.fn.filterFind = function(selector) {
return this.find('*') // Take the current selection and find all descendants,
MadLittleMods /
Last active Aug 29, 2015
Does not allow defines to be run by `eval`
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: for details
//Not using strict: uneven strict support in browsers, #392, and causes
//problems with requirejs.exec()/transpiler plugins that may not be strict.
/*jslint regexp: true, nomen: true, sloppy: true */
/*global window, navigator, document, importScripts, setTimeout, opera */
MadLittleMods / recursive-convert-keys.js
Last active Aug 29, 2015
Convert Object Keys according to Table/Map object
View recursive-convert-keys.js
// Demo:
// GitHub Gist:
// Code Review:
// These are used to determine the map/table format
var const_objectKeyPropertyName = '_short';
var const_objectValuePropertyName = '_object';
var const_arrayKeyPropertyName = '_array_item';
function convertKeys(object, map, reverseMap)
View gulp-run-tasks-and-get-streams.js
// Run the given tasks and returns their streams
// This will also take care of any task dependencies
// This is basically a custom gulp task orchestartor.
// Written for this SO question:
// Gist:
// Usage:
// gulp.task('all-txt', function() {
MadLittleMods / App-react-flux-async-dependent-store-init.js
Last active Aug 29, 2015
Flux: Initialize from asynchronous storage with interdependent stores - `waitFor` async - The real solution to this problem would be to create a DAO/service to feed data into the store via actions.
View App-react-flux-async-dependent-store-init.js
import React from 'react';
import SomeStore from '../stores/SomeStore';
import AppActions from '../actions/AppActions';
function gatherSomeStoreState(props, state) {
return {
myRandomNumber: SomeStore.getRandomNumber()
MadLittleMods / mypostcss.js
Last active Aug 29, 2015
A custom System.js plugin to load in post css. Usage: `import 'somestyles.css!mypostcss';`
View mypostcss.js
// Based off of geelen's gists:
import postcss from 'postcss';
import inlineComments from 'postcss-inline-comment';
import mixins from 'postcss-mixins';
import nestedcss from 'postcss-nested';
import cssvariables from 'postcss-css-variables';
//import autoprefixer from 'autoprefixer-core';
MadLittleMods / TextAreaWithTabs.cs
Created May 20, 2015
Unity GUI text area: `MLMEditorGUI.TextAreaWithTabs(Rect position, string text)`
View TextAreaWithTabs.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Reflection;
using self = MLMEditorGUI;
using System.Collections.Generic;
public class MLMEditorGUI : MonoBehaviour {
MadLittleMods / wrap-with-html-if.js
Created Jul 24, 2015
Wrap some content with a tag without having to deal with the concat hell :P
View wrap-with-html-if.js
// tag: '<a href="foo.html">'
// ex. usage: `wrapWithHtmlIf('<a href="foo.html">', 'Hello World', function() { return true });`
// output: '<a href="foo.html">Hello World</a>'
var wrapWithHtmlIf = function(tag, content, testCb) {
if(testCb()) {
return tag + content + '</' + tag.match(/<(\w*?)(?:\s|\>)/)[1] + '>';
return content;
You can’t perform that action at this time.