Skip to content

Instantly share code, notes, and snippets.

View michaeltrainor's full-sized avatar
:octocat:
Riding in a giant-spinning-molten-crust-ball spaceship.

haktwld michaeltrainor

:octocat:
Riding in a giant-spinning-molten-crust-ball spaceship.
View GitHub Profile
@ryanflorence
ryanflorence / static_server.js
Last active June 10, 2024 02:37
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@NatashaTheRobot
NatashaTheRobot / BreakoutCreateBounceBall
Created November 9, 2011 23:05
This is the solution to step 3 of the Stanford CS106A Breakout game assignment, creating a ball and making it bounce off the walls
//These are declared outside the method, but in the class.
/**Ball velocity*/
private double vx, vy;
/**Random number generator for vx*/
private RandomGenerator rgen = RandomGenerator.getInstance();
/** Animation delay or paust time between ball moves */
private static final int DELAY = 10;
@ielshareef
ielshareef / site_id_djangononrel_mongodb.md.md
Created June 25, 2012 04:13
Error on Django-nonrel and MongoDB: AutoField (default primary key) values must be strings representing an ObjectId on MongoDB (got u'1' instead). Please make sure your SITE_ID contains a valid ObjectId string.

Fixing SITE_ID for Django-nonrel and MongoDB

by Ismail Elshareef

Django's database setting are by default set to work with relational databases. Therefore, certain issues start popping up when you work with noSQL databases, like MongoDB.

Problem

If you're running Django-nonrel with Mongodb, you will run into an issue when you execute the following command:

@andresgutgon
andresgutgon / dosbatch.sublime-build
Created October 29, 2012 15:12 — forked from mmuell/dosbatch.sublime-build
Batch File Running for Sublime Text 2
{
"cmd": ["$file"],
"working_dir": "$file_path",
"selector": "source.dosbatch"
}
@johnhunter
johnhunter / 3scene.tmpl.js
Created April 6, 2013 20:50
THREE.js scene template
var camera, scene, renderer,
geometry, material, mesh;
init();
animate();
function init() {
scene = new THREE.Scene();
@EdCharbeneau
EdCharbeneau / Visual Studio Extensions
Last active December 28, 2015 11:09
Must have extensions for Visual Studio 2013
#Must have extensions for Visual Studio 2013
- [Entity Framework Power Tools (Beta)](http://msdn.microsoft.com/en-US/data/jj593170)
- [Git Diff Margin](http://visualstudiogallery.msdn.microsoft.com/cf49cf30-2ca6-4ea0-b7cc-6a8e0dadc1a8)
- [JavaScript Parser](https://code.google.com/p/js-addin/)
- [Web Essentials 2013](http://vswebessentials.com/)
- [Productivity Power Tools 2013](http://visualstudiogallery.msdn.microsoft.com/dbcb8670-889e-4a54-a226-a48a15e4cace?SRC=Home)
- [SideWaffle](http://t.co/MQXzCMPoVK)
# Nuget Packages
@natelandau
natelandau / .bash_profile
Last active June 13, 2024 18:01
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 29, 2024 13:05
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@timsneath
timsneath / profile.ps1
Last active June 17, 2024 11:08
PowerShell template profile: adds some useful aliases and functions
### PowerShell template profile
### Version 1.03 - Tim Sneath <tim@sneath.org>
### From https://gist.github.com/timsneath/19867b12eee7fd5af2ba
###
### This file should be stored in $PROFILE.CurrentUserAllHosts
### If $PROFILE.CurrentUserAllHosts doesn't exist, you can make one with the following:
### PS> New-Item $PROFILE.CurrentUserAllHosts -ItemType File -Force
### This will create the file and the containing subdirectory if it doesn't already
###
### As a reminder, to enable unsigned script execution of local scripts on client Windows,
@liorbenhorin
liorbenhorin / MayaDockingClass.py
Last active October 3, 2023 13:01
Maya 2017 PySide2 Docking Qt QMainWindow
"""
This is what you need to do in order to get a qt window to dock next to maya channel box,
In all maya versions, including 2017 with PySide2
"""
__author__ = "liorbenhorin@gmail.com"
import sys
import os
import logging
import xml.etree.ElementTree as xml