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 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
%!TEX TS-program = xelatex | |
\documentclass[12pt]{scrartcl} | |
% The declaration of the document class: | |
% The second line here, i.e. | |
% \documentclass[12pt]{scrartcl} | |
% is a standard LaTeX document class declaration: | |
% we say what kind of document we are making in curly brackets, | |
% and specify any options in square brackets. |
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 attributes(xs, name) { | |
return is_element(xs)? xs.getAttribute(name) | |
: is_array(xs)? xs.map(attributes) | |
: is_sequence(xs)? map(xs, attributes) | |
: /* otherwise */ raise(TypeError('Not supported.')) | |
} | |
// vs | |
function attributes(xs, name) { |
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
/*! | |
* @description GRUNT! (.js) | |
*/ | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { |
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
// easing functions http://goo.gl/5HLl8 | |
Math.easeInOutQuad = function (t, b, c, d) { | |
t /= d/2; | |
if (t < 1) { | |
return c/2*t*t + b | |
} | |
t--; | |
return -c/2 * (t*(t-2) - 1) + b; | |
}; |
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
$ = jQuery | |
queues = {} | |
running = false | |
queue = (name) -> | |
name = 'default' if name is true | |
queues[name] or= [] | |
next = (name) -> |
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
// Example usage: | |
// deepPopulate(blogPost, "comments comments._creator comments._creator.blogposts", {sort:{title:-1}}, callback); | |
// Note that the options get passed at *every* level! | |
// Also note that you must populate the shallower documents before the deeper ones. | |
function deepPopulate(doc, pathListString, options, callback) { | |
var listOfPathsToPopulate = pathListString.split(" "); | |
function doNext() { | |
if (listOfPathsToPopulate.length == 0) { | |
// Now all the things underneath the original doc should be populated. Thanks mongoose! | |
callback(null,doc); |
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
(def date-parsers [nil (java.text.SimpleDateFormat. "yyyy") (java.text.SimpleDateFormat. "yyyy-M") (java.text.SimpleDateFormat. "yyyy-M-dd")]) | |
(def grains [:decade :year :month :day]) ;; what's decade doing? | |
(map #(let [[_ year month day] (re-find #"(\d{2,4})[-_]([\dx]{2})[-_]([\dx]{2})" %) | |
date (first (split-with (partial not= "xx") [(if (= (count year) 2) (str "19" year) year) month day]))] | |
[(.parse (parsers (count date)) (clojure.string/join "-" date)) (grains (count date))]) | |
["thefilehasaname__1939-xx-01.mp3" | |
"thefilehasaname__39_01_01.mp3" | |
"thefilehasaname__39-01-01.mp3" |
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/java -jar clojure-1.7.0-master-SNAPSHOT.jar | |
(let [pom-uber-jar | |
(str "http://thelibraryofcongress.s3.amazonaws.com/" | |
"pomegranate-0.0.13-SNAPSHOT-jar-with-dependencies.jar") | |
cl (java.net.URLClassLoader. (into-array [(java.net.URL. pom-uber-jar)])) | |
cx (.getContextClassLoader (Thread/currentThread))] | |
(push-thread-bindings {clojure.lang.Compiler/LOADER cl}) |
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 (root, factory) { | |
"use strict"; | |
if (typeof define === 'function' && define.amd) { | |
define(['moment'], factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(require('moment')); | |
} else { | |
factory(root.moment); | |
} | |
}(this, function (moment) { |
OlderNewer