Skip to content

Instantly share code, notes, and snippets.

View sole's full-sized avatar
🌞
🌿🌱

sole sole

🌞
🌿🌱
View GitHub Profile
@sole
sole / jquery.tinycarousel.modified.js
Created January 23, 2012 15:52
tinycarousel.js with destroy function
/*!
* Tiny Carousel 1.9
* http://www.baijs.nl/tinycarousel
*
* Copyright 2010, Maarten Baijs
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/gpl-2.0.php
*
* Date: 01 / 06 / 2011
@sole
sole / cvt.py
Created January 24, 2012 09:15
Script to downsample images for book creation - original by Eric Jeschke. I'm adapting it to Python 3
#! /usr/bin/env python
#
"""
cvt.py -- script to downsample images for book creation
Comments, patches welcome:
Eric Jeschke (eric@redskiesatnight.com)
(c) 2009 Eric R. Jeschke (eric@redskieatnight.com).
This work is licensed under a Creative Commons Attribution-Share Alike
@sole
sole / xcodezombie.sh
Created February 22, 2012 10:29
XCode...
# http://stackoverflow.com/questions/788277/iphone-strange-error-when-testing-on-simulator
ps ax | grep Simulator
# list zombie processes
ps -el | grep "Z"
@sole
sole / imagemagick-slice.sh
Created March 7, 2012 14:52
Imagemagick slice
# http://broutilles.com/2011/04/22/imagemagick-how-to-slice-an-image-in-parts/
convert svg-cards.png -crop 179x260 +repage +adjoin cards_%02d.png
var Car = function() {
this.beep = function() {
return 'beep';
}
this.honk = function() {
return 'honk';
}
return this;
@sole
sole / munit_advanced.js
Created May 29, 2012 13:30
munit.js advanced example
var array;
var arrayTest = new MUNIT.Test([
function lengthZeroWhenEmpty() {
this.assertEquals(0, array.length);
},
function lengthNotZeroIfNotEmpty() {
array.push(1);
this.assertTrue(array.length != 0);
},
@sole
sole / FirstPersonControls2.js
Created July 28, 2012 12:55
FirstPersonControls put on a diet ;-)
/**
* @author mrdoob / http://mrdoob.com/
* @author alteredq / http://alteredqualia.com/
* @author paulirish / http://paulirish.com/
*/
THREE.FirstPersonControls2 = function ( object, domElement ) {
var latitude = 0,
longitude = 0,
phi = 0,
@sole
sole / unroll.fs
Created August 30, 2012 18:15
This is how I UNroll
float find_closest(int x, int y, float c0) {
/*
Original looping code, from http://devlog-martinsh.blogspot.com.es/2011/03/glsl-dithering.html
vec4 dither[4];
dither[0] = vec4( 1.0, 33.0, 9.0, 41.0);
dither[1] = vec4(49.0, 17.0, 57.0, 25.0);
dither[2] = vec4(13.0, 45.0, 5.0, 37.0);
dither[3] = vec4(61.0, 29.0, 53.0, 21.0);
@sole
sole / php-cgi.rc.sh
Created September 24, 2012 19:30 — forked from zliang-min/php-cgi.rc.sh
php-cgi rc script for archlinux
#!/bin/bash
# vim: syntax=sh
. /etc/rc.conf
. /etc/rc.d/functions
daemon_name=php-cgi
BIND=/tmp/php-cgi.socket
USER=gimi
@sole
sole / gist:4121881
Created November 20, 2012 23:04 — forked from Ricket/gist:2044441
Three.js mouse picking
var projector = new THREE.Projector();
var ray = projector.pickingRay( mouseCoord, camera ); // (mouse coord are in screenspace and must be [-1, 1])
var objects = ray.intersectObjects( scene.children );
if( objects.length )
{
objects[ 0 ].object; // THREE.Particule or THREE.Mesh
objects[ 0 ].face; // THREE.Face3 or THREE.Face4 (is .object is a Mesh
objects[ 0 ].point; // THREE.Vector3
}