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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<title>Coddee</title> | |
<link rel="stylesheet" href="stylesheets/master.css" /> | |
</head> | |
<body id="tutorial"> | |
<div id="layout-header"> | |
<h1>coddee</h1> |
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
from django.db import models | |
class TimeAwareModel(models.Model): | |
created_on = models.DateTimeField(editable=False, auto_now_add=True) | |
updated_at = models.DateTimeField(editable=False, auto_now=True) | |
class Meta: | |
abstract = True |
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
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'> | |
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> | |
<head> | |
<meta http-equiv='Content-Type' content='text/html;charset=utf-8' /> | |
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'> | |
<title></title> | |
<meta name='description' content=''> | |
<meta name='author' content=''> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0'> | |
<link rel='stylesheet' type='text/css' href='css/master.css' /> |
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
mongoose.Types.DocumentArray.prototype.sortByDir = function(direction, path) { | |
this.sort(function(a, b) { | |
var aVal = a.get(path), | |
bVal = b.get(path); | |
if (!aVal && !bVal) return 0; | |
if (!aVal) return 1; | |
if (!bVal) return -1; | |
if (direction > 0) return !(aVal < bVal); | |
return (aVal < bVal); | |
}); |
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
ffmpeg -i hlah_3.flac -strict experimental -acodec vorbis -aq 100 hlah.ogg |
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 | |
import subprocess | |
import signal | |
import sys | |
STATICGEN_ROOT = (os.path.join(os.path.dirname( | |
os.path.dirname(os.path.abspath(__file__))), | |
'staticgen')) | |
staticgen_path = lambda *a: os.path.abspath(os.path.join(STATICGEN_ROOT, *a)) |
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 fontforge | |
import os.path | |
filename = 'the-filename' | |
basename, ext = os.path.splitext(filename) | |
desired_formats = ['otf', 'eot'] | |
font = fontforge.open(filename) | |
for desired_format in desired_formats: | |
font.generate('%s.%s' % (basename, desired_format)) |
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
/* String to Number */ | |
var hello = '1234' | |
parseInt(hello) // Use this when speed is a concern (see http://jsperf.com/parseint-vs-unary) | |
// 1234 | |
+hello // unary operator -- use this when file size is a concern | |
// 1234 | |
+hello++ // Converts `hello` to a number and adds 1 to it |
OlderNewer