Skip to content

Instantly share code, notes, and snippets.

View drawcode's full-sized avatar
😎
Shipping product

Ryan Christensen drawcode

😎
Shipping product
View GitHub Profile
function encrypt(text){
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
function decrypt(text){
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq')
var dec = decipher.update(text,'hex','utf8')
// make console.log safe to use
window.console || (console = { log: function(){}});
function cacheChecker() {
console.log("cacheChecker", 1);
#multiple-datasets .league-name {
margin: 0 20px 5px 20px;
padding: 3px 0;
border-bottom: 1px solid #ccc;
}

Multithreading in Java http://java.sun.com/docs/books/tutorial/essential/threads/index.html

A Thread class is defined in the Standard Java libraries, with the methods: start, run, wait, notify, sleep, and system functions block, unblock, dispatch, etc

Implementing Threads in Java

Java provides two ways to create a new thread of execution

@drawcode
drawcode / git-remove-filter-branch.sh
Created May 29, 2014 03:44
# remove big file from tree
# remove big file from tree
git filter-branch --tree-filter 'rm -f path/to/bigfile.zip'
// Copyright (c) 2012 Calvin Rien
// http://the.darktable.com
//
// This software is provided 'as-is', without any express or implied warranty. In
// no event will the authors be held liable for any damages arising from the use
// of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
# Mostly stolen from deap's symbreg GP example
import operator
import math
import random
import string
import inspect
import ctypes
import numpy
from scipy import optimize
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
@drawcode
drawcode / unity-generate-mesh.cs
Created April 7, 2014 17:35
Unity generate mesh
// http://kobolds-keep.net/
// This code is released under the Creative Commons 0 License. https://creativecommons.org/publicdomain/zero/1.0/
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class ProceduralTerrain : MonoBehaviour {
public int width = 10;
@drawcode
drawcode / photonobject.cs
Created April 2, 2014 12:11
Photon Unity Network Object.
using UnityEngine;
using System.Collections;
public class ThirdPersonNetwork : Photon.MonoBehaviour
{
ThirdPersonCamera cameraScript;
ThirdPersonController controllerScript;
void Awake()
{