Skip to content

Instantly share code, notes, and snippets.

@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
require 'ubygems'
require 'finalcut' # http://gist.github.com/397955
files = ARGV
tick = 0.2
margin = 0.2
out = 'out.mp4'
FinalCut.open(*files) do |fc|
durations = files.map {|f| fc.get_duration f }
@guenter
guenter / move_to_rds.rb
Created November 11, 2010 02:14
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'
@kopiro
kopiro / steifscript-v1.4-enc.js
Created August 11, 2011 13:45
Steifscript v1.4 (enc)
// OE Version
javascript:eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('l{6(m["7"]){8 0=o.p(q,9,r,b,s,t,u,v,b,w,9,x,y,z,A,B);8 3=C("D E "+0+" c d.\\F e G H I 2 J K L f.\\n\\M N g 2 5 2 O P:","");6(3){3+="\\n[Q R "+0+" c d]";7.S().T(U(a){V.W("X g 2 "+a+"..");h Y().Z("/10/11/5.12").13({14:(h 15().i())+":"+(16()+1),17:18.i(),2:a,19:3}).5()});4(0+" 1a.")}j 4("1b 1c!")}j 4("f 1d e 1e.")}1f(k){4(0+" 1g 1h:\\n"+k)}',62,80,'_ssname||to|_sstext|alert|send|if|AvailableList|var|116||105|by|Kopiro|not|Facebook|message|new|getTime|else|ex|try|window||String|fromCharCode|83|101|102|115|99|114|112|32|118|49|46|52|prompt|Welcome|in|nDo|use|this|script|make|spam|on|nInsert|the|online|users|sent|using|getAvailableIDs|forEach|function|console|log|Sending
@ezterry
ezterry / KPatch.py
Created May 1, 2012 00:40
Hack acer 4.0 kernel to allow mounting of system
import gzip
import os
import sys
import StringIO
import struct
#This script will <EVIL> patch the pre-compiled zImage
#to bypass the /system remount block on the AcerA500
#ICS rom ... please run this script in linux or cygwin as
#the unix gzip is required
@Wollw
Wollw / livestream.sh
Created September 23, 2012 03:37
LiveStream with FFMPEG
CHANNEL="YOURCHANNEL"
USER="YOURUSERNAME"
PASSWD="YOURPASSWORD"
W_RATIO=16
H_RATIO=9
AUDIO="-f mp3 -i http://localhost:8000"
ffmpeg \
$AUDIO \
@xissy
xissy / getYoutubeVideoInfo.coffee
Last active July 25, 2024 03:38
Get a youtube video information from get_video_info.
request = require 'request'
youTubeMovieInfo =
youTubeMovieId: 'videoId'
url = "http://www.youtube.com/get_video_info?video_id=#{youTubeMovieInfo.youTubeMovieId}"
request.get url, (err, res, body) ->
return callback(false) if err
return callback(false) if res.statusCode isnt 200
@wilmoore
wilmoore / readme.md
Last active February 11, 2024 22:32
UMD-inspired Module Boilerplate

UMD-Inspired JS Module Boilerplate

This is the module format you don't know you need until you need it. Write your module once and have it work in a CJS/NodeJs, AMD, YUI (v3+), or Browser Global environment.

Best Used When...

  • You are migrating from namespaced (err, globals) code to either AMD or CJS modules or both.
  • You can't yet factor out browser globals but also need to test your code via NodeJS (e.g. Mocha).

Benefits & Trade-offs

@wouterj
wouterj / post.md
Last active July 13, 2021 02:00
How to use Jekyll, Plugins and Sass on GitHub Pages

How to use Jekyll, Plugins and Sass on GitHub Pages

Jekyll is a great CMS for developers and GitHub Pages is a great host to store your Jekyll sites. There is just one problem, GitHub runs Jekyll in safe mode, which means you can't use plugins. One thing you can do is building the Jekyll website locally and then push to GitHub.

Alexandre Rademaker found a solution to do this easially, which is quite usefull: "GitHub Pages and Jekyll plugins" After reading this I thought, that can be done easier!

Aliases to rescue

Git provides a way to have aliases of bash commands. You can do this by adding items to the alias key of your configuration. For this, you can add this locally by adding this lines to your %PROJECT_ROOT%/.git/config file:

@jordanorelli
jordanorelli / gif_example.pde
Created February 20, 2013 02:38
make an animated gif with Processing
import gifAnimation.*;
GifMaker gifExport;
int frames = 0;
int totalFrames = 120;
public void setup() {
smooth();
size(400, 400);