Skip to content

Instantly share code, notes, and snippets.

View mudphone's full-sized avatar

Kyle Oba mudphone

View GitHub Profile
;; Display alchemist buffers always at the right side
;; Just change (side . right) with the position you would like 'bottom, 'top, 'right or 'left
;; Source: http://www.lunaryorn.com/2015/04/29/the-power-of-display-buffer-alist.html
(add-to-list 'display-buffer-alist
`(,(rx bos (or "*alchemist test report*"
"*alchemist mix*"
"*alchemist help*"))
(display-buffer-reuse-window
display-buffer-in-side-window)
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@kongtomorrow
kongtomorrow / gist:e95bea13162ca0e29d4b
Last active August 31, 2022 16:20
Y combinator in Swift!
/* The Y combinator in Swift!
For a discussion of what the heck this is all about, see http://www.ece.uc.edu/~franco/C511/html/Scheme/ycomb.html
The nifty thing is that it allows us to implement recursion without the ability for a function to refer to itself from within its own definition.
Note how we manage a recursive definition of factorial without any function referring to its own name.
Thanks to @eridius for help with the SelfToUnderlying<T> type.
*/
// Y-combinator in Swift.
func Y<y,⒴>(𝖸:((y)->⒴)->((y)->⒴))->((y)->⒴){
var Y:((y)->⒴)!;Y=𝖸{Y($0)};return Y
}
// Couldn't find a way to avoid such explicitness.
// If types are defined in the inner function, compiler cannot infer type of 'f'.
let factorial = Y {(f:((Int)->Int)) -> ((Int)->Int) in
return {n in
@avescodes
avescodes / 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.
@jlivni
jlivni / index.html
Last active December 11, 2015 17:48
topojson on gmaps
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body, #map_canvas { height: 100%; margin: 0;}
</style>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://raw.github.com/mbostock/topojson/master/topojson.js"></script>
<script src="https://raw.github.com/JasonSanford/GeoJSON-to-Google-Maps/master/GeoJSON.js"></script>
@ctford
ctford / row-row-row-your-boat.clj
Created June 5, 2012 19:59
Row, row, row your boat!
(ns overtunes.songs.row-row-row-your-boat
(:use
[overtone.live]))
(definst harpsichord [freq 440]
(let [duration 1]
(*
(line:kr 1 1 duration FREE)
(pluck (* (white-noise) (env-gen (perc 0.001 5) :action FREE))
1 1 (/ 1 freq) (* duration 2) 0.25))))
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@vreon
vreon / .Xresources
Created February 27, 2011 03:26
molokai color theme for xterm
! Molokai theme
*xterm*background: #101010
*xterm*foreground: #d0d0d0
*xterm*cursorColor: #d0d0d0
*xterm*color0: #101010
*xterm*color1: #960050
*xterm*color2: #66aa11
*xterm*color3: #c47f2c
*xterm*color4: #30309b
*xterm*color5: #7e40a5