Skip to content

Instantly share code, notes, and snippets.

View sjl's full-sized avatar

Steve Losh sjl

View GitHub Profile
@sjl
sjl / zl.vim
Created January 17, 2014 17:46
Zip Right Vim mapping
" Zip Right
"
" Moves the character under the cursor to the end of the line. Handy when you
" have something like:
"
" foo
"
" And you want to wrap it in a method call, so you type:
"
" println()foo
@sjl
sjl / gist:7831019
Last active December 30, 2015 12:48

hello world!

function! StayStar()
let v = winsaveview()
execute normal! "*\<c-o>"
call winrestview(v)
endfunction
nnoremap * :call StayStar()<cr>

I need a key to move the cursor to the space before the current WORD. Here's my use case:

.
                                   cursor --v
$ java -jar foo.jar run /some/long/path/here#
<c-magic>
$ java -jar foo.jar run#/some/long/path/here
              cursor --^

That way I can c-w to kill that run command and then type out a different one, but preserving the path.

n = BigDecimal(row.bigDecimal("mycol").get).toBigIntExact.get
row.bigDecimal("mycol") // returns Option[java.math.BigDecimal]
row.bigDecimal("mycol").get // pull the java.math.BigDecimal out (will scream if it's a None)
BigDecimal(row.bigDecimal("mycol").get) // convert to a scala.math.BigDecimal
BigDecimal(row.bigDecimal("mycol").get).toBigIntExact // convert to Option[scala.math.BigInt]
BigDecimal(row.bigDecimal("mycol").get).toBigIntExact.get // pull out the bigint or scream if it was a None
@sjl
sjl / gist:6466546
Last active December 22, 2015 11:38 — forked from panicsteve/gist:1641705
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@sjl
sjl / gist:6084108
Last active December 20, 2015 06:09
# Dialects

I pronounce the # character a bunch of different ways, depending on the context:

thing how I say it
#python on freenode irc pound python
#! in the first line of a script hash bang (as in "hash bang bin bash")
#include in a C file pound include
#+ and #- Lisp reader thingies sharp plus and sharp minus
#' Lisp reader thing sharp quote
#(...) Clojure function pound paren
@sjl
sjl / gist:6055325
Last active December 20, 2015 02:19
Realforce 104UG High Profile

Flickr's new redesign sounds pretty cool, but I've moved over to 500px and don't see myself ever coming back. Here's why.

Signin is a Clusterfuck

Oh cool, Flickr redesigned. Let's see what's new. I'll click signin.

Okay, now I'm on a generic Yahoo-branded page. So much for design. Okay, type in username and password and ignore the other crap on the page.