Skip to content

Instantly share code, notes, and snippets.

View eddsteel's full-sized avatar
🐻
😒

Edd Steel eddsteel

🐻
😒
  • Vancouver, Canada
View GitHub Profile
@eddsteel
eddsteel / argh.kt
Last active March 13, 2019 18:52
nullables and varargs
fun f(vararg strings: String, block: () -> Unit): String {
// this implementation makes no sense, but the signature it's based on does.
block()
return if (strings.isEmpty()) {
"hello"
} else {
strings.reduce{ a, b -> a + b }
}
}
@eddsteel
eddsteel / post.md
Last active June 17, 2017 04:55
Links for forum post
  • ensime - "Scaladoc comments are indented according to the Scaladoc style guide".

  • vim-scala refers to "the indentation standard as recommended for Scaladoc comments" and links to the guide.

  • Intellij apparently uses "formatting for ScalaDoc2" in its UI.

  • scalafmt has two options for indenting scaladoc: "ScalaDoc" and "JavaDoc".

In addition Twitter, Databricks and Spark style guides all refer to "ScalaDoc style", as does my employer's. Others don't mention it specifically but begin their guides "where unspecified, refer to the official guide". Oops, which one?

Keybase proof

I hereby claim:

  • I am eddsteel on github.
  • I am eddsteel (https://keybase.io/eddsteel) on keybase.
  • I have a public key whose fingerprint is 1BE8 48D7 6C7C 4C51 349D DDCC 3362 0159 D403 85A0

To claim this, I am signing this object:

@eddsteel
eddsteel / extract-fspot-tags.sh
Created December 22, 2011 21:35
Extract F-Spot tags from photos.db to a text file.
sqlite photos.db 'select p.base_uri, p.filename, t.name from photos p, tags t, photo_tags pt where p.id = pt.photo_id and t.id = pt.tag_id;' >> photo-tags.txt
@eddsteel
eddsteel / _vimrc
Created April 19, 2011 09:04
Allow gvim to be started from windows or the cygwin shell, peacefully co-existing with a symlinked .vimrc
" because cygwin sets $HOME, ~/.vimrc will be read if you launch gvim from cygwin.
" If you have a _vimrc as well, this will be read in preference on windows.
" You can then source your normal windows rc (which you probably pointed back at your unix one directly,
" avoiding symlinks.
" If you have pathogen, this will make it work on gvim launched from cygwin as well!
let &rtp = &rtp.','.'D:/opt/cygwin/home/<user name here>/dotfiles/home/.vim' " Where your bundles are.
so D:/opt/vim/_vimrc " Whatever your windows rc is.