Skip to content

Instantly share code, notes, and snippets.

View bartschuller's full-sized avatar

Bart Schuller bartschuller

View GitHub Profile
@lrytz
lrytz / z-automator.png
Last active February 4, 2023 21:20
Shortcut for Syntax Highlighting in Keynote
@eamelink
eamelink / predicates.scala
Created June 25, 2014 16:06
Composable predicates
class SimpleFile
class ExtendedFile extends SimpleFile
implicit class Predicate[-A](val fn: A => Boolean) {
def &&[B <: A](other: Predicate[B]): Predicate[B] = Predicate { (x: B) =>
fn(x) && other.fn(x)
}
}
@paulp
paulp / brew
Created April 22, 2014 20:17
A unifying wrapper for brew and brew cask.
#!/usr/bin/env bash
#
# A wrapper for brew and brew cask.
#
Brew=/usr/local/bin/brew # hard to avoid hardcoding path if we want to call this "brew"
Cask="$Brew cask"
CaskRegex="^ [-] ([a-z]*):.*"
brewCommands () { $Brew commands | egrep -v commands$ | sort -u; }
@paulp
paulp / test.scala
Created February 1, 2013 17:57
statically typed companion objects
package s
object Test {
// Observe that x.companion is statically typed such that foo is callable
def f1() = {
val x = new Foo
println(x) // Foo instance
println(x.companion) // Foo companion
println(x.companion.foo) // I'm foo!
@mads-hartmann
mads-hartmann / bundles.sh
Created December 7, 2010 16:04
This is how I manage my textmate bundles.
#
# This script will install the following Textmate bundles
#
# Languages
# - c https://github.com/textmate/c.tmbundle
# - coffeescript https://github.com/jashkenas/coffee-script-tmbundle
# - context free https://github.com/textmate/context-free.tmbundle
# - erlang https://github.com/textmate/erlang.tmbundle
# - haskell https://github.com/textmate/haskell.tmbundle.git
# - html https://github.com/textmate/html.tmbundle