Skip to content

Instantly share code, notes, and snippets.

View qtrfeast's full-sized avatar

Avery Quinn qtrfeast

View GitHub Profile
@qtrfeast
qtrfeast / metadata.md
Last active December 31, 2015 23:29
Short-hands section for clojure.org/metadata

Short-hands

In addition to with-meta, there are a number of short-hand reader macros for affixing metadata to objects.

  • ^{:doc "How obj works!"} obj - Sets the metadata of obj to the provided map. Equivalent to (with-meta obj {:doc "How obj works!"}).
  • ^:dynamic obj - Sets the given keyword to true in the object's metadata. Equivalent to ^{:dynamic true} obj.
@qtrfeast
qtrfeast / project.clj
Created September 4, 2013 15:20
User.clj is evaluated three times when :source-paths and [:repl-options :init-ns] are specified
(defproject usertwice "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]]
:source-paths ["."]
:repl-options {:init-ns user})
@qtrfeast
qtrfeast / .tmux.conf
Created May 10, 2013 14:48
Tmux it up
set -g default-terminal "xterm-256color" # More colors
set-option -g xterm-keys on # Work more nicely with odd key combos (emacs)
set -g base-index 1 # Tabs start at '1', not '0'
set -s escape-time 0 # Faster activation
# Bind <C-q> to leader
# Make sure to update status-right to include your leader!
unbind C-b
set -g prefix C-q
bind-key q send-prefix
@qtrfeast
qtrfeast / Editing Clojure with Emacs
Last active July 5, 2022 13:32
Get started editing Clojure in Emacs with this basic config.
Check out README.md to get started editing Clojure with Emacs.
@qtrfeast
qtrfeast / upsearch.sh
Created January 4, 2013 16:48 — forked from anonymous/upsearch.sh
Recursively search upwards for a directory or file.
upsearch () {
if test -e "$1"; then
echo "$PWD"
else
if [ "$PWD" = "/" ]; then
return 1;
else
pushd .. > /dev/null
upsearch "$1"
exit_status=$?
@qtrfeast
qtrfeast / advanced-paredit.clj
Created October 25, 2012 18:07
Paredit FTW
;; Add more parens with wrap! M-(
(+ 1 * 2 3) ; -> (+ 1 (*) 2 3)
;; Slurp
;; To the right with C-right
(+ 1 (*) 2 3) ; -> (+ 1 (* 2) 3)
;; To the left with C-M-left
(+ 1 (*) 2 3) ; -> (+ (1 *) 2 3)
;; and Barf
@qtrfeast
qtrfeast / resources.md
Created June 28, 2012 19:26 — forked from alandipert/resources.md
Clojure training additional resources
<script type="text/javascript">
var queueBytesLoaded = 0;
var queueBytesTotal = 0;
var myQueue = null;
var queueChangeHandler = function(queue){
// alert('Uploading Started');
myQueue = queue;
// console.log("COLLECTION CHANGE!");
var list = document.getElementById('file_todo_list');
@qtrfeast
qtrfeast / your-project-test.js
Created April 29, 2012 19:44
Sample npm mocha test
var mocha = require('mocha');
var expect = require('chai').expect;
describe("My project", function () {
it("should know its version", function () {
var myProject = require('../index');
expect(myProject.version).to.not.equal(undefined);
expect(myProject.version).to.equal('0.0.0');
});
});
In the language of your choice write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".