Skip to content

Instantly share code, notes, and snippets.

@spicycode
spicycode / .ctags
Created March 27, 2013 14:17
.ctags
-R
--exclude=.svn
--exclude=.git
--exclude=vendor
--exclude=*.min.js
--c++-kinds=+p
--fields=+iaS
--extra=+qf
--totals=yes
--tag-relative=yes
@hongymagic
hongymagic / pr.md
Last active December 15, 2017 09:50 — forked from piscisaureus/pr.md
Checkout pull-requests from Atlassian Stash without adding remote

Locate the section for your stash remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@stash.internal:private/repository.git

Now add the line fetch = +refs/pull-requests/*:refs/remotes/origin/pull-requests/* to this section. Obviously, change the stash url to match your project's URL. It ends up looking like this:

@petehunt
petehunt / gist:8396968
Created January 13, 2014 09:14
Sweet.js DSL for making persistent data structures feel imperative
macro := {
rule infix { $obj $([ $key ] ...) | $rval:expr } => {
$obj = mori.assoc_in($obj, [$key (,) ...].reverse(), $rval)
}
}
macro hash_map {
rule {{ $($key : $value) (,) ... }} => {
mori.hash_map($($key, $value) (,) ...)
}
@thomcc
thomcc / Jelly-Physics.markdown
Created February 2, 2014 20:07
A Pen by Thom Chiovoloni.
@noprompt
noprompt / slurp.clj
Created February 19, 2014 04:52
How to use slurp from ClojureScript
(ns foo.core
(:refer-clojure :exclude [slurp]))
(defmacro slurp [file]
(clojure.core/slurp file))
;; In CLJS
(ns bar.core
(:require [foo.core :include-macros true :refer [slurp]]))
anonymous
anonymous / gist:b1f303426e51f8509a0b
Created June 4, 2014 21:14
processing motion blur
// Processing motion blur
// 'time' runs from 0 to 1
// ignore everything above the /////////
// by Dave @ beesandbombs
int[][] result;
float time;
void setup() {
setup_();
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@pleasetrythisathome
pleasetrythisathome / form.cljs
Last active May 7, 2016 05:45
om forms - form parent local state as cursor
(def inputs [{:korks :email}
{:korks [:name :first]}
{:korks [:name :last]}])
(defn form [app owner]
(reify
om/IInitState
(init-state [this]
(reduce (fn [state {:keys [korks]}]
(assoc-in state korks nil))
@shibukawa
shibukawa / goto.c
Last active November 20, 2020 11:27
goto for JS
first:
printf("first\n")
goto third;
second:
printf("second\n");
thrid:
printf("third\n");
@georgebrock
georgebrock / Info.plist
Last active December 8, 2023 22:12
AppleScript to handle URLs
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<!-- Add this section: -->
<key>CFBundleURLTypes</key>
<array>
<dict>