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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
STDIN.read.split("\n").each{ |line| puts line if (line =~ /CONFLICT/) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'midi-winmm' | |
class Numeric | |
def to_hex | |
"%02x" % self | |
end | |
end | |
class String | |
def to_hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
('123456789', 235039) | |
('12345678', 212761) | |
('11111111', 76348) | |
('dearbook', 46053) | |
('00000000', 34953) | |
('123123123', 20010) | |
('1234567890', 17794) | |
('88888888', 15033) | |
('111111111', 6995) | |
('147258369', 5966) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer