Skip to content

Instantly share code, notes, and snippets.

View rktoomey's full-sized avatar

Rose Toomey rktoomey

View GitHub Profile
@rktoomey
rktoomey / .psqlrc
Created April 24, 2020 15:50
Postgres
-- By default, NULL displays as an empty space. Is it actually an empty
-- string, or is it null? This makes that distinction visible.
\pset null '[NULL]'
-- Use table format (with headers across the top) by default, but switch to
-- expanded table format when there's a lot of data, which makes it much
-- easier to read.
\x auto
-- Verbose error reports.
\set VERBOSITY verbose
-- Use a separate history file per-database.
@rktoomey
rktoomey / .gitconfig
Created April 23, 2020 16:53
Git configs
[user]
name = XXX
email = XXX
# signingkey = XXX
[github]
user = rktoomey
token = XXX
[url "git@github.com:"]
insteadOf = "https://github.com/"
[clean]

Keybase proof

I hereby claim:

  • I am rktoomey on github.
  • I am rktoomey (https://keybase.io/rktoomey) on keybase.
  • I have a public key whose fingerprint is 9E44 BBA6 6B2E D886 5E9A C7FA A722 7A55 95E7 B5B0

To claim this, I am signing this object:

@rktoomey
rktoomey / networks.js.patch
Created March 31, 2015 21:09
networks.js support for regtest
Index: ../bitcore/lib/networks.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- ../bitcore/lib/networks.js (revision 1004aee17e7189bde59dd983bd456d7e3e7a418b)
+++ ../bitcore/lib/networks.js (revision )
@@ -143,9 +143,23 @@
'testnet-seed.bluematt.me',
'testnet-seed.alexykot.me',

Keybase proof

I hereby claim:

  • I am rktoomey on github.
  • I am rktoomey (https://keybase.io/rktoomey) on keybase.
  • I have a public key whose fingerprint is 31DA 4556 7493 1114 185A AF6C 042D 0CCD 4701 305C

To claim this, I am signing this object:

scala> val l = List(2d, 1d, 4d, Double.NaN, 4d, Double.NaN, -99d, 666d)
l: List[Double] = List(2.0, 1.0, 4.0, NaN, 4.0, NaN, -99.0, 666.0)
scala> l.max
res0: Double = 666.0
scala> l.min
res1: Double = -99.0
scala> l.sorted
@rktoomey
rktoomey / sbt.scala
Created May 3, 2013 20:50
Happy gen-idea funtime
~/workspace/sample $ sbt
Detected sbt version 0.12.2
Starting sbt: invoke with -help for other options
Using ~/.sbt/0.12.2 as sbt dir, -sbt-dir to override.
# Executing command line:
/usr/lib/jvm/java-7-oracle/bin/java
-Dfile.encoding=UTF8
-XX:MaxPermSize=256m
-Xms512m
-Xmx1g
package mongoverse
case class FooCursor(_grater: Grater[Foo],
underlying: DBCursor,
/* more input params */) extends TransformingCursor[Foo, Bar](_grater, underlying) {
def _newInstance(cursor: DBCursor) = FooCursor(_grater, cursor, /* params */)
def transform(a: Foo) = /* compose Foo instance with inputs to return a Bar instance */
}
@rktoomey
rktoomey / console.scala
Created August 7, 2012 14:35
Suppress default args
scala> import model._
import model._
scala> import model.suppress_default_args._
import model.suppress_default_args._
scala> import com.novus.salat._
import com.novus.salat._
scala> import com.mongodb.casbah.Imports._
@rktoomey
rktoomey / console.scala
Created July 30, 2012 12:48
Updating with SalatDAO
scala> import model._
import model._
scala> import org.bson.types.ObjectId
import org.bson.types.ObjectId
scala> import com.mongodb.casbah.Imports._
import com.mongodb.casbah.Imports._
scala> val _id = new ObjectId