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
// cellRadius is the distance from center to vertex or length of an edge | |
// longSpan is the long side of the triangle | |
// shortSpan is short side | |
float[][] XM = new float[][] { { 1 / (2*longSpan), -1 / cellRadius }, { 1 / longSpan, 0 } }; | |
float[][] YM = new float[][] { { 1 / (2*longSpan), 1 / cellRadius }, { -1 / (2*longSpan), 1 / cellRadius } }; | |
HVector pixel2hex(PVector pv) { | |
int n; | |
PVector mj = floorDot(pv, matrixXM); |
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/python | |
import os, sys | |
from optparse import OptionParser | |
from zencoder import Zencoder | |
DEBUG=False | |
if os.environ.get('ZENCODER_API_KEY'): | |
ZENCODER_API_KEY=os.environ.get('ZENCODER_API_KEY') | |
elif DEBUG: |
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
echo 4 10 2 38 39 4 39 4 10 4 44 4 4 38 6 38 38 6 11 32 4 11 52 14 39 \ | |
38 38 10 40 40 4 38 38 38 | fmt -1 | sort | uniq -c | sort -nr |
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
# django-wiki hook for django-cms | |
from django.conf.urls.defaults import patterns | |
from cms.app_base import CMSApp | |
from cms.apphook_pool import apphook_pool | |
from django.utils.translation import ugettext_lazy as _ | |
from wiki.urls import get_pattern as get_wiki_pattern | |
from django_notify.urls import get_pattern as get_notify_pattern | |
class WikiApphook(CMSApp): |
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/python | |
import os, sys, string, re, MacOS | |
from string import capwords | |
import fontforge as ff | |
from optparse import OptionParser | |
TEST = False | |
SKIP_FILES = ['.DS_Store', '.AppleDB', 'convert_font.log', 'Icon?'] | |
ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
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/python | |
import os, sys, string, re, MacOS | |
from string import capwords | |
import fontforge as ff | |
from optparse import OptionParser | |
SKIP_FILES = ['.DS_Store', '.AppleDB', 'convert_font.log', 'Icon?'] | |
class DirectoryWalker: |
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
// | |
// Responsive Margin & Padding Shortcuts for Twitter Bootstrap 3.0 | |
// --------------------------------------------------------------- | |
// This is an addition to Twitter Bootstrap that allows additional margin and padding shortcuts | |
// for enhanced layout control purposes. It should be included after the bootstrap.less | |
// import statement or precompiled as you see fit. It differs from bootstrap standards in | |
// that for any given screen size it predetermines the margin/padding size. All you have to | |
// do is specify the size you want xs,sm,md,lg, or xl. The exception is for items that you | |
// want to be centered using auto left/right margins. This can be device responsive by | |
// specifying mc-xs, mc-sm, mc-md, or mc-lg depending on when you want that behavior. |
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
index: function(req, res) { | |
Person | |
.find() | |
.populate('user') | |
.exec(function peopleFound(err, people) { | |
console.log(err); | |
if (err) return res.json(err, 400); | |
if (!people) return res.json({ error: 'No people exist.' }, 404); | |
res.json(people); | |
}); |
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
$ sudo sysctl -w net.inet.ip.forwarding=1 | |
$ sudo natd -interface en1 | |
$ sudo ipfw add divert natd ip from any to any via en1 |
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
// Import SVG Files as Layers - Illustrator CS3 script | |
// Description: Imports a folder of SVG files as named layers into a new document | |
// Author: Robert Moggach ([email protected]) | |
// Version: 0.0.1 on 2014-05-29 | |
function getFolder() { | |
return Folder.selectDialog('Please select the folder to be imported:', Folder('~')); | |
} |
OlderNewer