Skip to content

Instantly share code, notes, and snippets.


G. Ralph Kuntz, MD grkuntzmd

  • Gainesville, Florida
View GitHub Profile
View Golang filename without extension.go
package main
import (
func fileNameWithoutExtension(fileName string) string {
return strings.TrimSuffix(fileName, filepath.Ext(fileName))
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 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()

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

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 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] = {