Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
struct Triangle {
public int p1;
public int p2;
public int p3;
public Triangle(int point1, int point2, int point3) {
@miketucker
miketucker / gist:3772118
Created September 23, 2012 15:56
turbulence library bugs
-------- GLSL error: ERROR: Uniform precision mismatch '_NoiseOffset'
ERROR: Uniform precision mismatch '_Frequency'
ERROR: Uniform precision mismatch '_AnimSpeed'
ERROR: Uniform precision mismatch '_Time'
ERROR: Uniform precision mismatch '_Amplitude'
Vertex Shader:
@miketucker
miketucker / multiplatform.shader
Created September 17, 2012 19:56
multiplatform shader
#endif
#ifdef FRAGMENT
varying lowp vec3 xlv_TEXCOORD2;
varying lowp vec3 xlv_TEXCOORD1;
varying highp vec2 xlv_TEXCOORD0;
uniform lowp vec4 _WorldSpaceLightPos0;
uniform sampler2D _MainTex;
uniform lowp vec4 _LightColor0;
@miketucker
miketucker / gist:2775466
Created May 23, 2012 14:17
Encode some h264 videos, multithreaded boo yah
require 'rubygems'
require 'streamio-ffmpeg'
threads = []
i = 1
Dir.glob('*.avi') do |f|
j = i.to_s
threads.push Thread.new {
begin
@miketucker
miketucker / twitter_cache.php
Created April 30, 2012 19:35
Caches a json file of your twitter timeline with a 10 minute timeout. Helpful to combat the API limit.
<?php
header('Content-type: text/json');
header('Content-type: application/json');
function savetwit ($username)
{
//create the rss feed
$local_file = './twitterfeeds/'.$username.'.json';
@miketucker
miketucker / Remove dropbox's green check icon from Finder windows
Created April 9, 2012 19:40
Remove dropbox's green check icon from Finder windows. USAGE: Open a Terminal window and paste entire contents.
file=/Applications/Dropbox.app/Contents/Resources/check.icns
[ -e "$file" ] && mv -f "$file" "$file.bak"
unset file
@miketucker
miketucker / i hate jesse
Created November 15, 2011 21:25
i hate jesse
/*
* jQuery Backstretch
* Version 1.2.4
* http://srobbin.com/jquery-plugins/jquery-backstretch/
*
* Add a dynamically-resized background image to the page
*
* Copyright (c) 2011 Scott Robbin (srobbin.com)
* Dual licensed under the MIT and GPL licenses.
*/
@miketucker
miketucker / gist:1366828
Created November 15, 2011 11:11
fade in
<script type="text/javascript">
$(document).ready(function () {
$("#logo").hide();
$("#logo").bind("load", function () { $(this).fadeIn(); });
});
</script>
class ImportController << ApplicationController
require 'net/http'
require 'net/https'
require 'uri'
#THIS METHOD TO SEND USER TO THE GOOGLE AUTHENTICATION PAGE.
def authenticate
# initiate authentication w/ gmail
# create url with url-encoded params to initiate connection with contacts api