Skip to content

Instantly share code, notes, and snippets.

Avatar

G. Ralph Kuntz, MD grkuntzmd

  • Gainesville, Florida
View GitHub Profile
@jnape
jnape / FutureEither.scala
Created Apr 3, 2013
Making dealing with Future[Either[L, R]] palatable in Scala
View FutureEither.scala
package com.thoughtworks.futureeither
import concurrent.{Await, Future}
import scala.concurrent.ExecutionContext.Implicits.global
import concurrent.duration.FiniteDuration
import java.util.concurrent.TimeUnit
class FutureEither[L, R](private val future: Future[Either[L, R]]) {
def flatMap[R2](block: R => FutureEither[L, R2]): FutureEither[L, R2] = {
View w540-debian-notes.md

Debian on ThinkPad W540

This is a short write-up of my experiences with installing Debian on a ThinkPad W540.

All commands should be run as root, unless indicated otherwise.

Table of Contents

Debian Install Notes

View gist:9c4afcd91fe24316cbf0
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@grkuntzmd
grkuntzmd / Haskell-debug-trace
Last active Aug 29, 2015
Haskell debug #haskell #debug
View Haskell-debug-trace
import Debug.Trace
debug :: Show a => String -> a -> a
debug description value =
trace (description ++ ": " ++ show value) value
View Golang filename without extension.go
package main
import (
"strings"
"path/filepath"
)
func fileNameWithoutExtension(fileName string) string {
return strings.TrimSuffix(fileName, filepath.Ext(fileName))
}