Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@MadLittleMods
MadLittleMods / Sublime Text 2 and Djaneiro "var" tab completion confict.md
Last active September 30, 2017 18:37
Fix the conflicting "var" tab completion with Djaneiro

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: {{ }}
@MadLittleMods
MadLittleMods / Unicoin-Miner.py
Last active November 21, 2018 07:48
StackExchange Unicoin Miner in Python, https://www.youtube.com/watch?v=B74NHzUbvYo
# 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 March 15, 2022 09:24
Unity Character Driver/Controller for Movement, Jumping, and Gravity
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 April 20, 2024 17:20
A Unity script to Simulate Pendulum Motion
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 June 4, 2021 11:52
Transition/Animate move to new parent - jQuery plugin
// 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 February 19, 2019 15:44
A RequireJS renderer module for adding UI modules/templates to the document
/*
* 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 September 17, 2014 16:44
Django Admin: Save with AJAX - Override `admin/change_form.html` template
{% 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 August 29, 2015 14:06
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: 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 January 22, 2021 06:29
Convert Object Keys according to Table/Map object
// 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)
@MadLittleMods
MadLittleMods / GenerateCustomFontWindow.cs
Last active March 1, 2023 16:30
Unity Editor Window script to generate fonts. See: http://gamedev.stackexchange.com/a/91936/16587
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