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
MadLittleMods / Sublime Text 2 and Djaneiro "var" tab completion confict.md
Last active Sep 30, 2017
Fix the conflicting "var" tab completion with Djaneiro
View Sublime Text 2 and Djaneiro "var" tab completion confict.md

This is a non-working tutorial. It does not completely solve the issue for some reason

Djaneiro is a sublime package that gives a bunch of snippets (tab completions) for Django including templating.

The most useful snippets I use are for templating:

  • var: {{ }}
View Unicoin-Miner.py
# Unicoin Miner
# By: Eric Eastwood (ericeastwood.com)
#
# ** Press the `P` key or `Space` to stop the program **
#
# Description:
# Looks for rocks and clicks them
# Unicoins were a April Fools Joke on all StackExchange sites
# Just wanted to try out some basic vision and input emulation
#
@MadLittleMods
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
MadLittleMods / Pendulum.cs
Last active Sep 23, 2019
A Unity script to Simulate Pendulum Motion
View Pendulum.cs
using UnityEngine;
using System.Collections;
// Author: Eric Eastwood (ericeastwood.com)
//
// Description:
// Written for this gd.se question: http://gamedev.stackexchange.com/a/75748/16587
// Simulates/Emulates pendulum motion in code
// Works in any 3D direction and with any force/direciton of gravity
//
@MadLittleMods
MadLittleMods / jquery-parent-to-animate.js
Last active Oct 8, 2018
Transition/Animate move to new parent - jQuery plugin
View jquery-parent-to-animate.js
// Usage:
// $('.box').parentToAnimate($('.new-parent'), 200);
// $('.box').parentToAnimate($('.new-parent'), 'slow');
// $('.box').parentToAnimate('.new-parent', 'slow');
jQuery.fn.extend({
// Modified and Updated by MLM
// Origin: Davy8 (http://stackoverflow.com/a/5212193/796832)
parentToAnimate: function(newParent, duration) {
duration = duration || 'slow';
@MadLittleMods
MadLittleMods / renderer.js
Last active Feb 19, 2019
A RequireJS renderer module for adding UI modules/templates to the document
View renderer.js
/*
* Available functions:
* renderer.replace(...options...)
* renderer.append(...options...)
* renderer.prepend(...options...)
* renderer.before(...options...)
* renderer.after(...options...)
*
* Options:
* module: The RequireJS module to render.
@MadLittleMods
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
MadLittleMods / require.no-eval-define.js
Last active Aug 29, 2015
Does not allow defines to be run by `eval`
View require.no-eval-define.js
/** 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: http://github.com/jrburke/requirejs 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
MadLittleMods / recursive-convert-keys.js
Last active Aug 29, 2015
Convert Object Keys according to Table/Map object
View recursive-convert-keys.js
// Demo: http://jsfiddle.net/MadLittleMods/g3g0g1L4/
// GitHub Gist: https://gist.github.com/MadLittleMods/7b9ec36879fd24938ad2
// Code Review: http://codereview.stackexchange.com/q/69651/40165
// 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 GenerateCustomFontWindow.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Xml;
using System;
using System.Reflection;
// This Unity Editor window was created for this GD.SE question: http://gamedev.stackexchange.com/a/91936/16587
// The XML->Font is from the question asker, Almo
You can’t perform that action at this time.