Skip to content

Instantly share code, notes, and snippets.

@gseitz
gseitz / trolling_haskell
Created April 8, 2016 10:01 — forked from quchen/trolling_haskell
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@gseitz
gseitz / gist:9082894
Created February 18, 2014 23:37 — forked from paulp/gist:9081797
scala> val buf = ListBuffer(1)
buf: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1)
scala> val xs = buf.toIterable match { case xs: List[Int] => xs }
xs: List[Int] = List(1)
scala> buf ++= 1 to 100
res11: buf.type = ListBuffer(1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100)
scala> xs
// ==UserScript==
// @author Gerolf Seitz
// @name Github Wide Diff.
// @description Make the diff view as wide as the browser window.
// @include https://github.com/*
// ==/UserScript==
(function () {
function addJQuery(callback) {
@gseitz
gseitz / lensed.scala
Created September 24, 2011 12:59 — forked from retronym/lensed.scala
Lensed
// see https://github.com/gseitz/Lensed
object Lensed {
import scalaz._
import Scalaz._
case class Address(street: String, number: Int)
case class Person(name: String, address: Address)
@gseitz
gseitz / gist:1105498
Created July 25, 2011 23:10 — forked from dcbriccetti/gist:1105497
Trying to get war file name from SBT
import sbt._
import Keys._
import com.github.siasia.{WebPlugin=>WP}
object MyBuild extends Build {
val myTask = TaskKey[Unit]("my-task")
lazy val myProject = Project("webproject", file("."), settings =Defaults.defaultSettings ++
@gseitz
gseitz / ImplicitTimerDemo.scala
Created July 13, 2011 07:24 — forked from dcbriccetti/ImplicitTimerDemo.scala
Example of using implicit conversions to avoid creating anonymous inner classes
package sample
import java.util.{TimerTask, Timer}
/**
* Shows Java way of creating an anonymous inner class to supply the code for a TimerTask.
*/
object TimerDemo extends Application {
new Timer().schedule(new TimerTask {
def run() {
@gseitz
gseitz / oxbow.icls
Last active November 22, 2023 08:54 — forked from oxbowlakes/oxbow.xml
IntelliJ IDEA color scheme for Scala/Java
<scheme name="oxbow" version="142" parent_scheme="Default">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2023-11-22T09:52:13</property>
<property name="ide">idea</property>
<property name="ideVersion">2023.2.5.0.0</property>
<property name="modified">2023-11-22T09:52:19</property>
<property name="originalScheme">oxbow</property>
</metaInfo>
<option name="LINE_SPACING" value="1.2" />
// A simple trait:
trait CascadingActions {
implicit def tToActioneerT[T](t: T) = Actioneer(t)
case class Actioneer[T](tee: T) {
def withAction(action: (T => Unit)): T =
withActions(action)
def withActions(actions: (T => Unit)*): T = {
#!/bin/sh -e
if [ ! $SBT_VERSION ]; then SBT_VERSION=0.7.4; fi
if [ ! $SBT_DIR ]; then SBT_DIR=$HOME/.sbt; fi
if [ ! $SBT_FILENAME ]; then SBT_FILENAME=sbt-launch-$SBT_VERSION.jar; fi
if [ ! $SBT_LOCATION ]; then SBT_LOCATION=$SBT_DIR/$SBT_FILENAME; fi
SBT_URL="http://simple-build-tool.googlecode.com/files/$SBT_FILENAME"
if [ ! -f $SBT_LOCATION ];