Skip to content

Instantly share code, notes, and snippets.

View zeroeth's full-sized avatar
🤖
🐱 🤖 🐱 🤖

[0] zeroeth

🤖
🐱 🤖 🐱 🤖
View GitHub Profile
// called with
[self shape_tree:3 angle:current_rotation leaves:5];
// definition
- (void)shape_tree:(int)depth angle:(GLint)angle leaves:(int)leaves {
double offset = 360/leaves;
for (double i = 0; i <= 360; i+=offset) {
glPushMatrix();
glScalef(0.5, 0.5, 1.0);
#!/usr/bin/env ruby
STDIN.read.split("\n").each{ |line| puts line if (line =~ /CONFLICT/) }
@RyanScottLewis
RyanScottLewis / gist:911786
Created April 9, 2011 21:23
BCR2000/BCF2000 SysEx Messages
require 'midi-winmm'
class Numeric
def to_hex
"%02x" % self
end
end
class String
def to_hex
@jeffkreeftmeijer
jeffkreeftmeijer / 1.png
Created April 18, 2011 08:34
Image difference blend
1.png
@desandro
desandro / halftone-cartesian.pde
Last active October 4, 2022 11:48
Half-ton halftones Processing sketch
// options
String imagePath = "img/desandro-avatar.jpg";
float res = 10; // resolution, dot density
float zoom = 3.0; // proportion to zoom image
boolean isAdditive = true; // true = RGB, false = CMY
float offsetAngle = 1; // affects dot pattern
/*
0 = no patter
0.05 = slight offset
1 = slight offset
@Ludo6431
Ludo6431 / decoder.py
Created December 4, 2011 22:29
KORG Monotribe AFSK firmware decoder
# -*- coding: utf-8 -*-
# KORG monotribe firmware decoder by:
# Ludovic Lacoste (aka Ludo6431) -- http://ludolacoste.com
#
# thanks to :
# Th0mas @ http://gravitronic.blogspot.com/2011/12/decoding-korg-monotribe-firmware.html
# nitro2k01 @ http://blog.gg8.se/wordpress/2011/12/04/korg-monotribe-firmware-20-analysis/
# decoder.py <input ascii bits file> <output file prefix>
@zeroeth
zeroeth / gist:1512565
Created December 23, 2011 00:51 — forked from ofan/gist:1508676
csdn passwords
('123456789', 235039)
('12345678', 212761)
('11111111', 76348)
('dearbook', 46053)
('00000000', 34953)
('123123123', 20010)
('1234567890', 17794)
('88888888', 15033)
('111111111', 6995)
('147258369', 5966)
@davatron5000
davatron5000 / gist:2254924
Created March 30, 2012 20:57
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@devinrhode2
devinrhode2 / clean-scrollbar.css
Created May 2, 2012 03:42
Like, basically PERFECT scrollbars
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
this has no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.
@timyates
timyates / rdp.coffee
Created June 8, 2012 11:03 — forked from rhyolight/rdp.js
Ramer-Douglas-Peucker line filtering algorithm in JavaScript
findPerpendicularDistance = ( point, line ) ->
[pointX,pointY] = point[0..1]
lineStart = x: line[0][0], y: line[0][1]
lineEnd = x: line[1][0], y: line[1][1]
slope = ( lineEnd.y - lineStart.y ) / ( lineEnd.x - lineStart.x )
intercept = lineStart.y - ( slope * lineStart.x )
Math.abs( slope * pointX - pointY + intercept ) / Math.sqrt( Math.pow( slope, 2) + 1)
douglasPeucker = ( points, epsilon ) ->
maxIndex = maxDistance = 0