Skip to content

Instantly share code, notes, and snippets.

# keep only necessary jars in the slug
START_SCRIPT="target/start"
if [ -f $START_SCRIPT ] && [ -d $SBT_USER_HOME/.ivy2 ] ; then
echo "-----> Dropping unnecessary ivy cached jars from the slug"
for jar in $(find $SBT_USER_HOME/.ivy2 -name '*.jar' | xargs -0) ; do
[[ -f "$jar" ]] || continue
jar_name=`basename "$jar"`
if grep $jar_name $START_SCRIPT >/dev/null; then
echo "Keeping: $jar_name"
else
import scalaz._, Scalaz._, effect._
type Env = Map[String,String]
type Error = String
case class AppStack[A](f: Env => IO[Validation[Error,A]])
object AppStack {
implicit val appStackMonad = new Monad[AppStack] {
def point[A](a: => A): AppStack[A] =
@ethul
ethul / vimrc
Created July 24, 2012 23:59
.vimrc
filetype off
call pathogen#infect()
syntax on
filetype plugin indent on
set nocompatible
set modelines=0
set gfn=Monospace\ 8
set tabstop=2
set softtabstop=2
@ethul
ethul / .bash_profile
Created November 14, 2012 01:53
.bash_profile
# Enables bash auto-completion for homebrew packages
source $(brew --prefix)/Library/Contributions/brew_bash_completion.sh
source $(brew --prefix)/etc/bash_completion.d/git-completion.bash
source $(brew --prefix)/etc/bash_completion.d/git-prompt.sh
source $(brew --prefix)/etc/bash_completion.d/scala
# Coreutils commands are prefixed with "g", in order to use them with
# their real names, uncomment the following.
#PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
#MANPATH="$(brew --prefix coreutils)/libexec/gnuman:$MANPATH"
@ethul
ethul / .gitignore
Created November 23, 2012 12:23
Free Kvs
.*swp
.*un~
trait CPList {
type Apply[A]
type :+:[F[_]] <: CPList
type Append[T <: CPList] <: CPList
}
trait NilCP[F[_]] extends CPList {
type Apply[A] = F[A]
type :+:[G[_]] = ConsCP[G,NilCP[F]]
type Append[G <: CPList] = ConsCP[F, G]
@ethul
ethul / autogrow.js
Last active December 25, 2015 07:38 — forked from thomseddon/gist:4703968
/*
* Adapted from: http://code.google.com/p/gaequery/source/browse/trunk/src/static/scripts/jquery.autogrow-textarea.js
*
* Works nicely with the following styles:
* textarea {
* resize: none;
* word-wrap: break-word;
* transition: 0.05s;
* -moz-transition: 0.05s;
* -webkit-transition: 0.05s;
@ethul
ethul / angular-ui--bootstrap-position--jqm.js
Created February 4, 2014 18:12
Snapshot of the ui.bootstrap.position module from 2013-11-30
angular.module('ui.bootstrap.position', [])
/**
* A set of utility methods that can be use to retrieve position of DOM elements.
* It is meant to be used where we need to absolute-position DOM elements in
* relation to other, existing elements (this is the case for tooltips, popovers,
* typeahead suggestions etc.).
*/
.factory('$position', ['$document', '$window', function ($document, $window) {
@ethul
ethul / heatmap.js--gmaps-heatmap.js
Last active August 29, 2015 14:07
Snapshot of pa7/heatmap.js gmaps-heatmap.js plugin
/*
* heatmap.js gmaps overlay
*
* Copyright (c) 2014, Patrick Wied (http://www.patrick-wied.at)
* Dual-licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and the Beerware (http://en.wikipedia.org/wiki/Beerware) license.
*/
function newHeatmapOverlay(google, map, cfg) {
// From https://code.google.com/p/gmaps-api-issues/issues/detail?id=3117#c12
function googleMapsFitBoundsAndZoom(google, map, bounds) {
function myFitBounds(myMap, bounds) {
myMap.fitBounds(bounds);
var overlayHelper = new google.maps.OverlayView();
overlayHelper.draw = function () {
if (!this.ready) {