This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nnoremap ; : | |
| set ts=2 | |
| set shiftwidth=2 | |
| set expandtab | |
| syntax on | |
| filetype indent on | |
| call pathogen#infect("~/.vim/bundle/{}") | |
| set statusline=%F | |
| set statusline+=%= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hashlib | |
| import time | |
| import math | |
| import hmac | |
| def lpad(x, padlen=16): | |
| if len(x) >= padlen: | |
| return x | |
| return '0'*(padlen-len(x)) + x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; A y combinator implementation of quicksort in Clojure | |
| (def g | |
| (((fn [f] | |
| (f f)) | |
| (fn [func] | |
| (fn [k] | |
| (cond | |
| (empty? k) | |
| k | |
| (= (count k) 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns infix) | |
| ;; Parse a set of expressions in infix format to something clojure can evaluate | |
| (defmacro expand-infix [expr] | |
| (cond (number? expr) | |
| expr | |
| (symbol? expr) | |
| expr | |
| (not (= (count expr) 3)) | |
| (throw (Exception. ">3 items ")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns kochcurve.core | |
| (:require [quil.core :as q] | |
| [quil.middleware :as m])) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn variadic-list? | |
| [arglist] | |
| (reduce (fn [v m] (or v (= m (symbol '&)))) false arglist)) | |
| (defn variadic? | |
| [argslists] | |
| (some variadic-list? argslists)) | |
| (defn argslists->counts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nnoremap ; : | |
| imap jj <ESC> | |
| execute pathogen#infect() | |
| syntax on | |
| filetype plugin indent on | |
| set noswapfile | |
| set ts=2 | |
| set ignorecase | |
| set expandtab | |
| set softtabstop=2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::io; | |
| use std::io::Write; | |
| use std::{thread, time}; | |
| use std::process::{Command, Stdio}; | |
| use rand::Rng; | |
| use libc; | |
| use nix::{ioctl_read_bad, convert_ioctl_res}; | |
| fn get_tty_rows_columns() -> Result<(i32, i32), String> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns transducertutorial.core) | |
| ;; a Reducing function is one that takes | |
| ;; an accumulator and an item | |
| ;; and returns a new accumulator with the item processed | |
| (defn my-reducing-fn | |
| [accumulator item] | |
| (conj accumulator item)) | |
| ;; conj is smart enough to know how to how to add the item to the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bb | |
| (defn what-to-do [arg] | |
| (condp | |
| = arg | |
| "save" :save | |
| arg)) | |
| (defn save-a-command | |
| [db db-location args] |