Skip to content

Instantly share code, notes, and snippets.

@dcsobral
dcsobral / prompt.sbt
Created May 28, 2011 01:04
SBT prompt with project name and current git branch
shellPrompt <<= name(name => { state: State =>
object devnull extends ProcessLogger {
def info(s: => String) {}
def error(s: => String) { }
def buffer[T](f: => T): T = f
}
val current = """\*\s+(\w+)""".r
def gitBranches = ("git branch --no-color" lines_! devnull mkString)
"%s:%s>" format (
name,
@maxbeatty
maxbeatty / site-links.css
Created October 14, 2012 21:54
Site Links from Lea Verou
@jvranish
jvranish / valueLevelClasses.hs
Created May 2, 2012 17:28
An experiment with mixing value level typeclasses and implicit parameters
{-# LANGUAGE Rank2Types
, RebindableSyntax
, ImplicitParams
, NoMonomorphismRestriction #-}
import Data.Maybe
import Data.Function
import Data.String
import Prelude (undefined, error, String, (++))
@paulp
paulp / The Signs of Soundness
Last active June 17, 2021 06:48
The Signs of Soundness
Hello scala, my old friend
I've come to take you home again
Because a feature slowly creeping
left me plagued with doubts and weeping
and the version that was tagged in the repo
just has to go
it lacks the signs of soundness
On sleepless nights I hacked alone
applying ant and other tools of stone
@dctrwatson
dctrwatson / nginx.conf
Last active March 19, 2023 08:56
Caching PyPi packages locally with nginx
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@chrisdone
chrisdone / AnIntro.md
Last active March 24, 2024 21:13
Statically Typed Lisp

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@Kestrer
Kestrer / how-to-write-hygienic-macros.md
Created October 17, 2020 05:35
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is