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
#!/bin/bash | |
family=`echo "$1"|tr ' ' '+'` | |
filename=`echo "$1"|sed 's/ //g'` | |
weight=$2 | |
subset=$3 | |
if [ "$weight" != "" ]; then | |
family="$family:$weight" | |
filename="$filename-$weight" |
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
// derived from https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/urlify.js | |
var TRANSLITERATE_MAP = { | |
// latin | |
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'AE', 'Å': 'A', 'Æ': 'AE', 'Ç': | |
'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I', | |
'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö': | |
'OE', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'UE', 'Ű': 'U', | |
'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a', 'â': 'a', 'ã': 'a', 'ä': | |
'ae', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', |
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
#!/bin/sh | |
dir="$1" | |
playlist="$2" | |
if [ "$playlist" = "" ]; then | |
playlist=playlist.m3u | |
fi | |
find "`readlink -f "$dir"`" -type f -and \( -iname '*.mp3' -or -iname '*.ogg' -or -iname '*.wav' -or -iname '*.flac' -or -iname '*.m4a' -or -iname '*.aac' -or -iname '*.wma' -or -iname '*.opus' \) > "$playlist" |
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
use weakref::{Weakref,Weakrefs,Referred}; | |
mod weakref; | |
struct Node { | |
weakrefs: ~Weakrefs<Node>, | |
parent: ~Weakref<Node>, | |
children: ~[~Node], | |
data: ~str | |
} |
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
class ConstStruct | |
def self.derive(name) | |
cls = Class.new(ConstStruct) | |
cls.instance_variable_set :@name, name | |
def cls.name; @name end | |
def cls.inspect; @name end | |
def cls.to_s; @name end | |
cls | |
end |
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
#!/bin/bash | |
do_printf=off | |
incs="" | |
flags="$CFLAGS" | |
only_preproc=off | |
no_asm=off | |
if [ "$CC" = "" ]; then | |
CC=gcc |
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
#!/bin/bash | |
incs="" | |
flags="$CXXFLAGS" | |
only_preproc=off | |
no_asm=off | |
no_space=off | |
if [ "$CXX" = "" ]; then | |
CXX=g++ |
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
CPP = g++ | |
LIB = `Magick++-config --cppflags --cxxflags --ldflags --libs` -lboost_thread-mt | |
CPPFLAGS = -Wall -O3 `Magick++-config --cppflags --cxxflags` | |
LDFLAGS = $(LIB) -Wall -O3 | |
BIN = visprim | |
.PHONY: all zip clean | |
all: $(BIN) |
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 python | |
import sys | |
import Image | |
from itertools import islice | |
def primes(): | |
yield False # 0 | |
yield False # 1 | |
yield True # 2 |