Skip to content

Instantly share code, notes, and snippets.

View lambdahands's full-sized avatar
🔮
~*srcery*~

Amani lambdahands

🔮
~*srcery*~
View GitHub Profile
@gorsuch
gorsuch / gist:1418850
Created December 1, 2011 18:37
clojure uuid
(defn uuid [] (str (java.util.UUID/randomUUID)))
anonymous
anonymous / Gemfile
Created August 16, 2013 01:03
Guard + LiveReload + Compass + Foundation = <3
source "http://rubygems.org"
group :development do
gem 'sass'
gem 'compass'
gem 'compass-validator'
gem 'css_parser'
gem 'guard'
gem 'guard-compass'
gem 'guard-shell'
@branneman
branneman / better-nodejs-require-paths.md
Last active April 8, 2024 00:22
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@jackrusher
jackrusher / rhyming-and-scheming.clj
Created January 26, 2014 22:42
Finding rhymes with clojure and CMU's pronunciation dictionary. Tested with this file, minus comments, as 'cmudict.txt': http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict.0.7a
(def rhyme-txt
(map #(string/split % #"[ ]+") (string/split-lines (slurp "cmudict.txt"))))
(def word-to-rhyme
(reduce (fn [m [word & rhyme]]
(assoc m
(string/lower-case word)
(mapv #(keyword (string/replace %1 #"[0-9]" "")) (reverse rhyme))))
{} rhyme-txt))
(require '[clojure.core.async :as a])
(def xform (comp (map inc)
(filter even?)
(dedupe)
(flatmap range)
(partition-all 3)
(partition-by #(< (apply + %) 7))
(flatmap flatten)
(random-sample 1.0)
(ns interop.core
(:require [cljs.nodejs :as nodejs]))
(nodejs/enable-util-print!)
(def Immutable (js/require "immutable"))
(extend-type Immutable.List
ISeqable
(-seq [coll]
@CmdrDats
CmdrDats / cqrs.clj
Last active January 2, 2016 04:44
Simple foray into Clojure CQRS/ES example. Now with Datomic.
(ns server.db.cqrs
(:use
[datomic-schema.schema :only [schema fields part]])
(:require
[datomic.api :as d]
[datomic.function :as df]
[datomic-schema.schema :as s]))
;; Some simple helper functions:
(defn error [^String msg]
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.

SHUT THE FUCK UP

@malyn
malyn / vim-fireplace-figwheel.diff
Created February 20, 2015 21:12
vim-fireplace patches/hack for compatibility with Figwheel
diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim
index 6c32caa..a415bf8 100644
--- a/plugin/fireplace.vim
+++ b/plugin/fireplace.vim
@@ -232,7 +232,9 @@ function! s:repl.piggieback(arg, ...) abort
else
let arg = ' :repl-env ' . a:arg
endif
- let response = connection.eval('(cemerick.piggieback/cljs-repl'.arg.')')
+ "let response = connection.eval('(cemerick.piggieback/cljs-repl'.arg.')')