Skip to content

Instantly share code, notes, and snippets.

@yrns
yrns / ramda
Last active June 19, 2016 20:41 — forked from raine/ramda
Browse Ramda documentation in Terminal
#!/usr/bin/env bash
# Browse Ramda documentation in Terminal
# Requires jq and rofi for interactive filtering
LATEST="http://raine.github.io/ramda-json-docs/latest.json"
DOCS_URL="http://ramdajs.com/docs/"
cached=$XDG_CACHE_HOME/$(basename $LATEST)
if [[ ! -r "$cached" ]]; then
@yrns
yrns / ramda-destruct.el
Created April 2, 2016 20:16
Emacs ramda-destruct
;; ramda-destruct
(defun ramda-destruct ()
(interactive)
;; save-excursion does not work with replace. Can't use point since
;; the buffer contents are changing.
(let ((line (line-number-at-pos))
(column (current-column)))
(shell-command-on-region (point-min) (point-max) "ramda-destruct" t t)
(goto-char (point-min))
(forward-line (- line 1))
@yrns
yrns / triangle-collision.js
Created March 6, 2016 22:40 — forked from toji/triangle-collision.js
Javascript Swept-Sphere/Triangle Collision Detection
/*
* Copyright (c) 2012 Brandon Jones
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
@yrns
yrns / .emacs
Created June 1, 2015 03:21
stripped .emacs
(dolist (mode '(menu-bar-mode tool-bar-mode scroll-bar-mode))
(when (fboundp mode) (funcall mode -1)))
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(load-library "iso-transl")
(defalias 'yes-or-no-p 'y-or-n-p)
@yrns
yrns / btss
Created August 29, 2014 20:57
Make the last audio sink the default so the volume buttons work on my keyboard when bluetooth speakers are connected...
#!/bin/sh
pacmd set-default-sink `pacmd list-sinks | grep index | tail -n 1 | perl -ne 'print "$1\n" if /(\d+)/;'`
@yrns
yrns / qr
Created August 25, 2014 20:44
Share clipboard text with a phone via QR code
#!/bin/sh
xclip -o | qrencode -t PNG -o- > /tmp/qr.$$; notify-send -i "/tmp/qr.$$" -t 0 -