Skip to content

Instantly share code, notes, and snippets.

View Blaisorblade's full-sized avatar

Paolo G. Giarrusso Blaisorblade

View GitHub Profile
@jrudolph
jrudolph / wello.scala
Created June 16, 2011 09:49
Wello Horld
\u006f\u0062\u006a\u0065\u0063\u0074\u0020
\u0057\u0065\u006c\u006c\u006f\u0048\u006f\u0072\u006c\u0064\u0020
\u0065\u0078\u0074\u0065\u006e\u0064\u0073\u0020
\u0041\u0070\u0070\u0020\u007b\u000a\u0020
\u0020\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028
\u0022\u0057\u0065\u006c\u006c\u006f\u0048\u006f\u0072\u006c\u0064\u0022
\u0029\u000a\u007d\u000a
@milessabin
milessabin / gist:2659013
Created May 11, 2012 11:08
Proving equality of type constructors in Scala via an "arbitrary object" encoding of universal quantification.
// Universal quantification is encoded in terms of quantifier-free
// assertions about an "abitrary" type (cp. "all swans are white" vs.
// "the arbitrary swan is white". Inspired by Kit Fine's 1985 "Reasoning
// with Arbitrary Objects", http://philosophy.fas.nyu.edu/object/kitfine.
//
// Possibly also related to Oleg Kiselyov's "Interpreting types as
// abstract values", http://okmij.org/ftp/Computation/index.html#teval.
// What I wouldn't give for kind-polymorphism here ...
#!/usr/bin/env bash
#
sync () {
local dir=build/quick/classes/$1
local jar=$(pwd)/build/pack/lib/scala-$1.jar
[[ -f $jar ]] && ( cd $dir && /usr/bin/zip --display-counts --filesync -r $jar * )
}
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@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
@TiarkRompf
TiarkRompf / GenericLifiting.scala
Last active November 30, 2017 16:28
generic class lifting and method forwarders
import language.experimental.macros
import language.dynamics
import scala.reflect.macros._
case class Rep[+T](x:String)
implicit def anyToRep[T](x:T) = new Rep[T](x.toString)
class ShouldLift[T]
@dagit
dagit / TeX.inputplugin
Last active May 15, 2020 14:34
Tex style input plugin for OSX. Save to your computer and double click the file to install it.This is based on work by Dan Piponi: https://plus.google.com/u/1/107913314994758123748/posts/6utGGHg4ti6
#
METHOD: TABLE
ENCODE: Unicode
PROMPT: TeX 1.2
VERSION: 1.2
DELIMITER: ,
MAXCODE: 6
VALIDINPUTKEY: ^,.?!:;"'/\()[]{}<>$%&@*01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
TERMINPUTKEY:
BEGINCHARACTER
@kogir
kogir / aero-restore-state.sh
Last active December 16, 2015 09:59
Simple sync scripts for symlinks in AeroFS. Create and run them from the root of your AeroFS folder.
#!/bin/bash
tar -xzf .aero-meta/symlinks.tgz
rm .aero-meta/symlinks.tgz
cat .aero-meta/exec.list | xargs -0 chmod +x
rm .aero-meta/exec.list
rm -rf .aero-meta
@milessabin
milessabin / gist:5611702
Created May 20, 2013 11:25
Since when was "<:" an alias for "extends" ... not that I'm complaining, mind ;-)
scala> trait Foo ; trait Bar <: Foo
defined trait Foo
defined trait Bar
scala> implicitly[Bar <:< Foo]
res2: <:<[Bar,Foo] = <function1>
@NathanHowell
NathanHowell / curry.hs
Created May 31, 2013 23:36
A proof-of-concept demonstrating the use of Z3 to solve Cabal version constraints for Haskell packages
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}