Skip to content

Instantly share code, notes, and snippets.

💭
trolling craigslist for free pallets

Chris Martin chris-martin

💭
trolling craigslist for free pallets
Block or report user

Report or block chris-martin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View large-haskell-projects-on-travis.md

Haskell projects with lots of dependencies on Travis CI

If your Haskell project has lots of dependencies, you can find yourself reaching the timeout while compiling them - the free service has a timeout of 50 minutes. How do we address this?

First, a quick reminder of build statuses in Travis CI:

All builds finish with one of four possible statuses: succeeded, failed, errored, or (manually) cancelled. The difference between a failed and errored

View Applied-FP-with-Scala.md

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
View install-nix.md

Step one

curl https://nixos.org/nix/install | sh

Step two

Add the following lines to the end of ~/.zshrc:

source $HOME/.nix-profile/etc/profile.d/nix.sh
@5outh
5outh / events.hs
Created May 3, 2016
Event System in Haskell
View events.hs
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad.State
import Data.Text
import Data.Monoid
import qualified Data.Map as M
import Control.Monad
@fiadliel
fiadliel / ZipReader.scala
Created Aug 30, 2015
Reading Zip files with scalaz-stream
View ZipReader.scala
import java.io.{File, FileNotFoundException, IOException, InputStream}
import java.util.zip.{ZipEntry, ZipException, ZipFile}
import org.http4s.DateTime
import scodec.bits.ByteVector
import scalaz._
import scalaz.Scalaz._
import scalaz.concurrent.Task
View web-of-trust.md

A pseudonymous trust system for a decentralized anonymous marketplace

Dionysis Zindros, National Technical University of Athens dionyziz@gmail.com

Keywords

pseudonymous anonymous web-of-trust identity trust bitcoin namecoin proof-of-burn timelock decentralized anonymous marketplace openbazaar

Abstract

View ummutable.scala
import scala.collection.mutable.ListBuffer
class Ummutable[T] private (buf: ListBuffer[T]) {
def this(xs: T*) = this(ListBuffer() ++= xs)
def append(ys: T*): this.type = { buf ++= ys ; this }
final val xs: List[T] = buf.toIterable match { case xs: List[T] => xs }
override def toString = s"Ummutable(xs = ${xs mkString ", "})"
}
View ==.md

@aredridel

Thought of the moment: I never use === in javascript. I find that every time I need it, I've made a boneheaded design flaw elsewhere.

‏@chris__martin

@aredridel === is a promise to the maintainer who comes after you that you knew what you were doing.

‏@aredridel

@TomasMikula
TomasMikula / Lazy.scala
Created Nov 26, 2013
lazily { expr }: Scala lazy vals that can be checked for having been evaluated. It is adapted from this StackOverflow answer: http://stackoverflow.com/a/17057490/1572599
View Lazy.scala
import scala.language.implicitConversions
object Lazy {
def lazily[A](f: => A): Lazy[A] = new Lazy(f)
implicit def evalLazy[A](l: Lazy[A]): A = l()
}
@jamesmfriedman
jamesmfriedman / rename_table_migration.py
Last active Sep 11, 2019
Renaming a Django app that has migrations already sucks. This Is a way I found to do it that preserves your old migration history and keeps your contenttypes in order. The trick is, this migration cannot be in the app you are migrating, so stick it in your "core" app or another app you have installed. Just plug in your own old and new app names.
View rename_table_migration.py
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.db.models import get_app, get_models
class Migration(SchemaMigration):
You can’t perform that action at this time.