This file contains hidden or 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
""" | |
Functions for flexibly formatting Python timedelta objects. | |
The following field codes apply: | |
d - days | |
M - minutes | |
h - hours | |
s - seconds | |
m - milliseconds | |
u - microseconds |
This file contains hidden or 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
(add-to-list 'auto-mode-alist '("\\.less$" . css-mode)) | |
(setq-default compile-less nil) | |
(add-hook 'css-mode-hook | |
(lambda () | |
(when (string-match "\\.less$" buffer-file-name) | |
(add-hook 'after-save-hook | |
(lambda () | |
(when compile-less | |
(funcall compile-less))))))) |
This file contains hidden or 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
((css-mode . ((compile-less . (lambda () (call-process "cake" nil nil nil "css")))))) |
This file contains hidden or 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
(ns myproject.tasks | |
(:use [cake.core :only (deftask defile)]) | |
(:import [java.io File] | |
[com.asual.lesscss LessEngine])) | |
(defn less->css | |
"Compiles the Less file at the given path into its CSS equivalent." | |
[less-path css-path] | |
(.compile (LessEngine.) (File. less-path) (File. css-path))) |
This file contains hidden or 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
(require '[clojure.string :as str]) | |
(defn keyword->setter [kw] | |
(->> (str/split (name kw) #"-") | |
(map str/capitalize) | |
(apply str "set") | |
(symbol))) | |
(defmacro bean-set! [bean props] | |
`(doto ~bean |
This file contains hidden or 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 | |
project=$1 | |
src_dir=$project | |
build_dir=/tmp/$project | |
mkdir "$build_dir" | |
for d in src lib; do | |
mkdir "${build_dir}/${d}" |
This file contains hidden or 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
ALL=$(wildcard src/*.js) | |
pacman.js: $(ALL) | |
cat `python tools/dependency-order.py $(ALL)` >pacman.js | |
.PHONY=clean | |
clean: | |
rm pacman.js |
This file contains hidden or 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 re | |
import sys | |
CLASSNAME = re.compile(r'^(?:(?:abstract )?class|interface) ([\w_]+)', re.MULTILINE) | |
CLASSES = re.compile(r'\b([A-Z][a-z]\w+([_\\][A-Z][a-z]\w)+)') |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
# Licensed under the MIT license: | |
# http://www.opensource.org/licenses/mit-license | |
# Copyright (c) 2013 [email protected] | |
import magic | |
from thumbor.engines import pil, opencv |
This file contains hidden or 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 bash | |
set -x | |
set -e | |
# Deploys a directory (within a git repo) to github.io by jamming it into the | |
# `gh-pages` branch. | |
# | |
# Note: it's assumed that you don't care about tracking history for `gh-pages`, | |
# as this script clobbers the branch every time. |
OlderNewer