Skip to content

Instantly share code, notes, and snippets.

Git Process

Overview

  • Reserve the master branch for production, staging, and hotfixes
  • Write new code on a feature branch
  • Rebase feature branches onto master as often as reasonable
  • Merge feature branches into master with a no-ff, no-squash merge commit
  • Preserve branch names for reference
on open theFiles
repeat with aFile in theFiles
if application "Adobe Photoshop CC" is running then
tell application "Adobe Photoshop CC"
open aFile
activate
end tell
else
tell application "Preview" to open aFile
end if
@wunki
wunki / wercker.yml
Created June 20, 2013 20:41
Wercker deployment script for Clojure.
box: wercker/default
services:
- wercker/postgresql
- wercker/rabbitmq
- wercker/redis
build:
steps:
- script:
name: install clojure
code: |
@afeld
afeld / gist:5704079
Last active June 6, 2025 21:03
Using Rails+Bower on Heroku
@teropa
teropa / resources.md
Last active December 4, 2020 05:42
Clojure Resources

Tutorials

@stuarthalloway
stuarthalloway / gist:5199642
Created March 19, 2013 20:11
Draw a pedestal dataflow with dorothy + Graphviz
;; from leiningen, use [dorothy/dorothy "0.0.3"]
(require '[dorothy.core :as dot])
;; dataflow copied from chat
;; https://github.com/pedestal/samples/blob/master/chat/chat-client/app/src/chat_client/behavior.clj
(def dataflow '{:transform
{:outbound {:init {} :fn outbound-transform}
:inbound {:init {} :fn inbound-transform}
:nickname {:init nil :fn nickname-transform}}
:effect {:outbound send-message-to-server}
@evandrix
evandrix / README.md
Created September 11, 2012 00:06
Headless web browsers

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@irace
irace / BIWebViewDelegate.m
Created September 10, 2012 02:51
JavaScript/native bridge for iOS's UIWebView
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType {
NSString *urlString = [[request URL] absoluteString];
if ([urlString hasPrefix:@"js:"]) {
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject]
stringByReplacingPercentEscapes];
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
@xtang
xtang / digest.clj
Created August 24, 2012 04:32 — forked from eliasson/digest.clj
Clojure md5 digest
(defn md5-sum
"Compute the hex MD5 sum of a string."
[#^String input]
(let [alg (doto (MessageDigest/getInstance "MD5")
(.update (.getBytes input)))
hash (.toString (new BigInteger 1 (.digest alg)) 16)
length (.length hash)]
(if (> 32 length)
;; 0x065 => 65, leading zero is dropped by BigInteger
(apply str (concat (repeat (- 32 length) \0) hash))
;; borrowed from ibdknox/jayq
(defn map->js [m]
(let [out (js-obj)]
(doseq [[k v] m]
(aset out (name k) v))
out))
(defn clj->js
"Recursively transforms ClojureScript maps into Javascript objects,
other ClojureScript colls into JavaScript arrays, and ClojureScript