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
#include <stdint.h> | |
#include <endian.h> | |
#define _MAGIC_FROM_CHARS(C1,C2,C3,C4) (uint32_t)(((C1) << 24) | ((C2) << 16) | ((C3) << 8) | (C4)) | |
#if __BYTE_ORDER == __LITTLE_ENDIAN | |
# define MAGIC_FROM_CHARS(C1,C2,C3,C4) _MAGIC_FROM_CHARS(C4,C3,C2,C1) | |
#elif __BYTE_ORDER == __BIG_ENDIAN |
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
BrowserPonies.loadConfig({"speed":3,"speakProbability":0.1,"volume":1,"interval":40,"fps":25,"interactionInterval":500,"audioEnabled":false,"showFps":false,"preloadAll":false,"showLoadProgress":true,"fadeDuration":500,"spawn":{"ScratchedDisk":1},"autostart":true,"ponies":[{"behaviors":[{"name":"Stand","probability":0.5,"maxduration":15,"minduration":7.56,"speed":0,"rightimage":"http://i.imgur.com/zCdjk.gif","leftimage":"http://i.imgur.com/fVo9j.gif","movement":"None","auto_select_images":false,"dont_repeat_animation":false,"skip":false,"x":0,"y":0,"rightcenter":{"x":53,"y":48},"leftcenter":{"x":53,"y":48},"group":0},{"name":"Trot","probability":0.5,"maxduration":15,"minduration":5,"speed":2,"rightimage":"http://i.imgur.com/OKpoI.gif","leftimage":"http://i.imgur.com/iRVOf.gif","movement":"Diagonal_horizontal","auto_select_images":false,"dont_repeat_animation":false,"skip":false,"x":0,"y":0,"rightcenter":{"x":53,"y":48},"leftcenter":{"x":53,"y":48},"group":0}],"speeches":[{"name":"Signing in","text":"Scratched |
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
function supportsSVG() { | |
return !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect; | |
} |
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
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine dir [master]$ # clean working directory | |
# username@Machine dir [master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ [\1$(parse_git_dirty)]/" |
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
function format (fmt, kwargs) { | |
var args = arguments; | |
var index = 1; | |
return fmt.replace(/{([^{}]*)}|{{|}}|{|}/g, function (match, key) { | |
if (key !== undefined) { | |
if (key) { | |
return kwargs[key]; | |
} | |
else { |