Skip to content

Instantly share code, notes, and snippets.

View wsargent's full-sized avatar

Will Sargent wsargent

View GitHub Profile

Useful Scalac Flags

So, there have been some discussions and angry tweets recently about irritating Scala "features" (like value discarding and auto-tupling) that can actually be turned off by selecting the right compiler flag in conjunction with -Xfatal-warnings. I highly recommend a set of options something like those below.

scalacOptions ++= Seq(
  "-deprecation",           
  "-encoding", "UTF-8",       // yes, this is 2 args
  "-feature",                
 "-language:existentials",

Keybase proof

I hereby claim:

  • I am wsargent on github.
  • I am will_sargent (https://keybase.io/will_sargent) on keybase.
  • I have a public key whose fingerprint is CD69 70B7 2D00 E5BE 9A33 0EF3 C1E8 BF06 2BC6 C4B7

To claim this, I am signing this object:

@wsargent
wsargent / gentrustanchor.sh
Last active August 29, 2015 14:00
Creates a JKS keystore that uses exampleCA as a trust anchor.
#!/bin/bash
export PW=`cat password`
# Create a JKS keystore that trusts the example CA, with the default password.
# This is used by the client.
keytool -import -v \
-alias exampleca \
-file exampleca.crt \
-keypass:env PW \
fooapp@srv:~$ cat app/env/PLAY_OPTS
export DATABASE_URL="jdbc:postgresql://127.0.0.1/foobar"
# We could wire a different configuration file here
# or set up a different database on the fly
export PLAY_OPTS="-DapplyEvolutions.default=true -DapplyDownEvolutions.default=true -Ddb.default.url="$DATABASE_URL" -Ddb.default.user=fooapp -Ddb.default.password=fooapppw -Ddb.default.driver=org.postgresql.Driver"
@wsargent
wsargent / URL
Created November 10, 2014 10:56
https://docs.google.com/a/typesafe.com/presentation/d/1QBhMeRRq5Gs5UfgaqvZ_3-LaxC-fQviLbPi5O8fA71c/edit?usp=sharing
#!/usr/bin/env bash
#
# A more capable sbt runner, coincidentally also called sbt.
# Author: Paul Phillips <paulp@typesafe.com>
# todo - make this dynamic
declare -r sbt_release_version=0.13.5
declare -r sbt_unreleased_version=0.13.5
declare -r buildProps=project/build.properties
@wsargent
wsargent / gist:655724
Created October 30, 2010 20:47
Want to do a callback
def setupMocks(onSubmitFunc(): => acm:ApplicationContextMock): Unit = {
val acm: ApplicationContextMock = new ApplicationContextMock
onSubmitFunc(acm)
tester = new WicketTester(new Application {
protected override def getSpringInjector: SpringComponentInjector = {
return new SpringComponentInjector(this, acm, true)
}
})
@wsargent
wsargent / building_base_vagrant_boxes.txt
Created October 3, 2011 07:44
Building a base vagrant box with RHEL / CentOS ISOs
[Provide gist to the building of base boxes below:]
http://vault.centos.org/4.0/isos/i386/
http://vault.centos.org/5.4/isos/x86_64/
http://vault.centos.org/5.1/isos/x86_64/
Vagrant documentation: http://vagrantup.com/docs/base_boxes.html
Building a base box: https://gist.github.com/354734
[Creating base boxes for RHEL 4 and RHEL 5 - 80 GB dynamic disks]
[Note that there is no easy way to change disk sizes - but you can add more]
@wsargent
wsargent / gist:1489171
Created December 17, 2011 04:24
Maven repositories suck.
[20:00:08] wsargent:framework git:(master*) $ ./build
Getting Scala 2.9.1 (for sbt)...
:: problems summary ::
:::: WARNINGS
module not found: org.fusesource.jansi#jansi;1.4
==== local: tried
/Users/wsargent/work/Play20/framework/./../repository/local/org.fusesource.jansi/jansi/1.4/ivys/ivy.xml
@wsargent
wsargent / gist:1492217
Created December 18, 2011 02:56
UNRESOLVED DEPENDENCIES
[18:55:51] wsargent:framework git:(master*) $ ./build
Getting Scala 2.9.1 (for sbt)...
:: problems summary ::
:::: WARNINGS
module not found: org.fusesource.jansi#jansi;1.4
==== local: tried
/Users/wsargent/work/Play20/framework/./../repository/local/org.fusesource.jansi/jansi/1.4/ivys/ivy.xml