Skip to content

Instantly share code, notes, and snippets.

var randomsentence = [
"ODDIO l'ultimo tweet di vincenzo lettera :°°D",
"wat",
"afkbai",
"*cloudapp link*",
"prima o poi devo rimettere in funzione culo.co.cc",
"!shadowman",
"D: Ma.. uffa!",
":O",":°°°°°°°°°°°°",
"!quote",
@Hamcha
Hamcha / english.json
Created September 7, 2012 23:45
dartMUSH English i18n file
{
"messages" : {
"welcome" : "Welcome, you'll soon enter %NAME% (World: %WORLD%),\r\nYou'll enter as a guest, you'll need to %WHITE%LOGIN%END% to affect the world\r\n",
"assignedname" : "You've been assigned the name %NAME%",
"userlist" : "\r\nYou see %PLAYERS%",
"locationlist" : "\r\nYou can go: %DIRECTIONS%",
"unknown_go" : "Go %WHITE%where?%END%",
@Hamcha
Hamcha / gist:3766666
Created September 22, 2012 16:26
Paradise reordering
$paradise = { YOUR MEGA WORLD THING HERE }
$paradise.each do |p|
parent = p[1]["parent"]
if $paradise.has_key?(parent)
unless $paradise[parent].has_key?("childs")
$paradise[parent]["childs"] = Array.new
end
$paradise[parent]["childs"].push(p)
$paradise.delete(p)
function gzip-test()
{
curl -I -s -H 'Accept-Encoding: gzip,deflate' $1 | grep Content-Encoding: || echo "No compression enabled"
}
function gzip-test-x()
{
curl -I -s -H 'Accept-Encoding: gzip,deflate' $1 | grep Content-Encoding: || print -P -- "$FX[bold]$FG[001][ERROR]%f GZip Not Enabled$FX[reset]"; return
NOGZIP=`curl -so /dev/null $1 -w '%{size_download}'`
@Hamcha
Hamcha / main.coffee
Created October 7, 2012 14:32
HTML5 Slideshow in Coffeescript / JS
############################
### Global Variables ###
############################
slides = []
curSlideIndex = 0
window.blockedIO = false
############################
@Hamcha
Hamcha / ftp.zsh
Created October 13, 2012 12:22
ZSH file for easy ftp uploading from terminal (requires NCFTP Client)
FTP_HOST=your.host.here
FTP_DIR=www/
FTP_USER=yourFTPusername
FTP_PASS=yourFTPpassword
ftp-upload() {
if [[ $1 == '' ]]; then
print -P $FG[001]"Please specify one or more files"$FX[reset]
@Hamcha
Hamcha / Benchmark Results (on my PC)
Created October 19, 2012 15:11
Benchmark.sh Results
__ JAVASCRIPT V8 (v8) __
real 0m0.658s
user 0m0.654s
sys 0m0.008s
__ NODE.JS (node) __
real 0m0.734s
user 0m0.721s
@Hamcha
Hamcha / visualizer.glsl
Created November 24, 2012 13:24
Simple music visualizer for Live-Coder
uniform vec2 resolution;
uniform float lowFreq, midFreq, highFreq;
uniform float time;
vec3 circle(vec2 root, vec2 position, float radius, vec3 color)
{
if (distance(position, root) < radius) return color;
return vec3(0);
}
@Hamcha
Hamcha / pinkb.glsl
Created November 24, 2012 16:08
Pink thing
uniform vec2 resolution;
uniform float lowFreq, midFreq, highFreq;
uniform float time;
uniform vec2 mouse;
void rX(inout vec3 p, float a) { float c,s;vec3 q=p; c = cos(a); s = sin(a); p.y = c * q.y - s * q.z; p.z = s * q.y + c * q.z; }
void rY(inout vec3 p, float a) { float c,s;vec3 q=p; c = cos(a); s = sin(a); p.x = c * q.x + s * q.z; p.z = -s * q.x + c * q.z;}
void rZ(inout vec3 p, float a) { float c,s;vec3 q=p; c = cos(a); s = sin(a); p.x = c * q.x - s * q.y; p.y = s * q.x + c * q.y; }
uniform vec2 resolution;
uniform float lowFreq, midFreq, highFreq;
uniform float time;
uniform vec2 mouse;
void rX(inout vec3 p, float a) { float c,s;vec3 q=p; c = cos(a); s = sin(a); p.y = c * q.y - s * q.z; p.z = s * q.y + c * q.z; }
void rY(inout vec3 p, float a) { float c,s;vec3 q=p; c = cos(a); s = sin(a); p.x = c * q.x + s * q.z; p.z = -s * q.x + c * q.z;}
float star(vec3 p, float s) { return length(p)-s; }
float starfield(vec3 p, float s, vec3 c) { vec3 q = mod(p,c)-.5*c; return star(q,s); }