Skip to content

Instantly share code, notes, and snippets.

View dubsgordon's full-sized avatar

Stephen Gordon dubsgordon

  • Blizzard Entertainment
  • Irvine, CA
View GitHub Profile
@dubsgordon
dubsgordon / web-servers.md
Created July 14, 2025 21:19 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
@dubsgordon
dubsgordon / scala.el
Created December 13, 2013 19:16 — forked from stew/scala.el
; scala-mode2 found here: https://github.com/hvesalai/scala-mode2 is much better than the scala mode that comes with scalac
(add-to-list 'load-path "~/.emacs.d/scala-mode2/")
(require 'scala-mode)
; http://www.emacswiki.org/emacs/RainbowDelimiters
(add-hook 'scala-mode-hook 'rainbow-delimiters-mode)
; I get ensime from git:
; https://github.com/aemoncannon/ensime
; then run `sbt stage` inside the ensime source directory,
import scalaz._
import Scalaz._
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.Await
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
object FSE extends App {
// scalaz doesn't yet have a monad instance for future, here is one.
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text 2 if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.