Skip to content

Instantly share code, notes, and snippets.

This diff is a modified version of a diff written by Arnis Lapsa.
[ The original can be found here: https://gist.github.com/ArnisL/6156593 ]
This diff adds support to tmux for 24-bit color CSI SRG sequences. This
allows terminal based programs that take advantage of it (e.g., vim or
emacs with https://gist.github.com/choppsv1/73d51cedd3e8ec72e1c1 patch)
to display 16 million colors while running in tmux.
The primary change I made was to support ":" as a delimeter as well
@chrisdone
chrisdone / typing.md
Last active March 22, 2024 23:24
Typing Haskell in Haskell

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

@paf31
paf31 / node-haskell.md
Last active April 14, 2021 18:42
Reimplementing a NodeJS Service in Haskell

Introduction

At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.

Over the past few months, I have been working on two Haskell services:

  • A reimplementation of an existing socket.io service, previously written for NodeJS using TypeScript.
  • A new service, which would interact with third-party components using standard data formats from the medical industry.

I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces

@aravindavk
aravindavk / gist:2b4298eeb2d8f949224b
Created September 24, 2014 12:15
Use Shared lib created in Rust from Python
#!/usr/bin/env python
"""
Consumer example to use the shared object created in Rust.
Ref: http://blog.skylight.io/bending-the-curve-writing-safe-fast-native-gems-with-rust/
Rust program: points.rs
use std::num::pow;
pub struct Point { x: int, y: int }
struct Line { p1: Point, p2: Point }
@ErikEvenson
ErikEvenson / Gruntfile.js
Created September 4, 2014 02:08
Gruntfile.js with generator-webapp and assemble
// Generated on 2014-09-03 using
// generator-webapp 0.5.0
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// If you want to recursively match all subfolders, use:
// 'test/spec/**/*.js'
@jashkenas
jashkenas / semantic-pedantic.md
Last active November 29, 2023 14:49
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

@andyfriesen
andyfriesen / TestableIO.hs
Last active August 10, 2021 18:25
Tiny example showing how to force your Haskell code to be 100% deterministic under unit tests
{-# LANGUAGE FlexibleInstances #-}
module Main where
import Control.Applicative ((<$>))
import Control.Monad.State.Lazy as S
class Monad m => World m where
writeLine :: String -> m ()
instance World IO where
@steveklabnik
steveklabnik / Entfremdung.md
Created August 3, 2014 18:15
alienation 101

Quick summary:

Alienation is one of the ways that capitalism sucks. It's a symptom that something's not right, not the underlying cause. Alienation is something that happens because of the way that capitalism is built.

In short, alienation is a separation between things that should be together. This separation causes tension.

Four ways that capitalism is alienating:

From your product of labor

@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active January 17, 2024 23:54
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps