Skip to content

Instantly share code, notes, and snippets.

View dschobel's full-sized avatar

Daniel Schobel dschobel

View GitHub Profile
@jsomers
jsomers / websters-kindle.mdown
Created May 19, 2014 01:42
How to make the Webster's 1913 your default Kindle dictionary

How to make the Webster's 1913 your default Kindle dictionary

  1. Download a Kindle-compatible version of the dictionary here. Unzip the .rar archive.

  2. Get the "Send to Kindle" program on your computer. Here's the link for the Mac.

  3. Right-click your recently downloaded (unzipped) dictionary file, and click the "Send to Kindle" menu item. It will arrive on your Kindle shortly.

  4. Once the dictionary has arrived, go to your settings -- on my newish paperwhite, it's at Home > Settings > Device Options > Language and Dictionaries > Dictionaries > English. Choose the Webster's 1913.

@slyphon
slyphon / clipboard.scala
Created May 28, 2013 03:04
This, more than anything, has improved my productivity an embarassing amount (w/ the scala repl)
import java.io.{PrintWriter, OutputStreamWriter, BufferedOutputStream}
// copy given string to the mac clipboard by launching pbcopy in a subprocess
object Clipboard {
def pbcopy(string: String) {
val pb = new ProcessBuilder("/usr/bin/pbcopy")
val p = pb.start()
val stdin = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(p.getOutputStream)))
stdin.print(string)
stdin.close()

Installation

FreeBSD

portmaster irc/irssi
portmaster irc/irssi-xmpp

OS X

brew install irssi

@graue
graue / gist:5079734
Last active December 14, 2015 11:29
Weirdness with JS closures (Lua behaves differently).
NOTE: Scroll down for explanation (the difference turns out to be scoping, not closures per se).
$ cat juices.lua
local fruits = {"apple", "orange", "grape"}
local juicers = {}
for i,v in ipairs(fruits) do
local fruit = v
juicers[i] = function() return fruit .. " juice" end
anonymous
anonymous / .ctags
Created May 12, 2011 00:19
--langdef=Scala
--langmap=Scala:.scala
--regex-Scala=/^[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/c,classes/
--regex-Scala=/^[ \t]*object[ \t]*([a-zA-Z0-9_]+)/\1/o,objects/
--regex-Scala=/^[ \t]*trait[ \t]*([a-zA-Z0-9_]+)/\1/t,traits/
--regex-Scala=/^[ \t]*case[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/r,cclasses/
--regex-Scala=/^[ \t]*abstract[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/a,aclasses/
--regex-Scala=/^[ \t]*def[ \t]*([a-zA-Z0-9_=]+)[ \t]*.*[:=]/\1/m,methods/
--regex-Scala=/[ \t]*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/V,values/
--regex-Scala=/[ \t]*var[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/v,variables/