Skip to content

Instantly share code, notes, and snippets.

View 23Skidoo's full-sized avatar

Mikhail Glushenkov 23Skidoo

View GitHub Profile
------------------------------------------------------------------------------------------
-- A formalization of the Cheryl's birtday problem; using Haskell/SBV
--
-- See: http://www.nytimes.com/2015/04/15/science/a-math-problem-from-singapore-goes-viral-when-is-cheryls-birthday.html
--
-- By Levent Erkok, This file is in the public domain. Use it as you wish!
--
-- NB. Thanks to Amit Goel for suggesting the formalization strategy used in here.
------------------------------------------------------------------------------------------
@romainguinot
romainguinot / checkgmail-2factor-support.patch
Last active December 14, 2015 09:50
checkgmail (http://checkgmail.sourceforge.net/) patch for two factor authentication (a.k.a two step) support (config, UI, integration), login refactoring (requests, UI), refactored kwallet integration, + additional refactoring/bugfixing. Applies against latest available revision (r47). Note : old version. Updated version with CSRF support here : h…
--- checkgmail 2013-02-28 14:24:44.614055113 +0100
+++ checkgmail.current 2013-03-01 22:22:30.211693526 +0100
@@ -33,13 +33,18 @@
# global variables (can't be set global in the BEGIN block)
my ($version, $silent, $nocrypt, $update, $notsexy, $profile, $disable_monitors_check,
- $private, $cookies, $popup_size, $hosted_tmp, $show_popup_delay,
- $popup_persistence, $usekwallet, $libsexy, $nologin, $mailno, $debug);
+ $private, $cookies, $two_factor_auth_switch, $popup_size, $hosted_tmp, $show_popup_delay,
+ $popup_persistence, $use_kwallet, $libsexy, $nologin, $mailno, $debug);
@michaelochurch
michaelochurch / 911-real-estate-boom
Last active January 2, 2016 04:19
Explanation of NYC's 9/11 Boom.
Real estate (like oil in the short term, cf. "oil shocks" of the 1970s) is extremely supply-inelastic,
such that a 1% loss of supply might cause prices to go up *a lot* more than 1%-- possibly 10%, 20%,
even 2x. The result of this is that a destruction of real estate supply will actually increase the
*total* market value: a cataclysmic loss of 5% of NYC's real estate would drive prices through the roof
and make the price level look "healthy" (from the buyer-centric perspective common in the US when it
comes to housing). But no value was created! Much was destroyed.
The 2000s run-up in NYC's housing costs was driven largely by speculation after 9/11. While we
*actually* had 12+ subsequent years with no major domestic terror attacks, there were a large number of
(esp. foreign) speculators who expected future attacks in major cities and bought lots of RE in
@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 #-}
@ezyang
ezyang / ghc-make.rst
Created August 22, 2016 08:49
Notes on GHC make

How ghc --make works

In abstract, the job of ghc --make is very simple: compute a dependency graph between modules, and rebuild the ones that have changed. Unfortunately, the code in GhcMake is quite a bit more complicated than that, and some of this complexity is essential to the design of GHC:

  • Interaction with GHCi involves mutating process-global state.
@thoughtpolice
thoughtpolice / Codensity.hs
Created September 12, 2012 07:14
Codensity transformation, problem set, solutions, notes, and other stuff
-- Inspired by the writings of Edward Kmett, Edward Yang and Gabriel Gonzalez
-- concerning free monads and the codensity transformation.
--
-- http://comonad.com/reader/2011/free-monads-for-less/
-- http://blog.ezyang.com/2012/01/problem-set-the-codensity-transformation/
-- http://www.haskellforall.com/2012/06/you-could-have-invented-free-monads.html
--
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
#!/usr/bin/env stack
{-
stack
--resolver lts-9.0
script
--package bytestring
--package Cabal
--package containers
--package filepath
--package http-client
@nkpart
nkpart / gist:cc852b43d948a33a04c8
Last active June 18, 2019 14:01
Using ghcid inside of emacs
Pieces you need:
* emacs
* ghcid
ghcid needs to know the height of the terminal, we'll set it explicitly
height = (window-height) - (scroll-margin) - 1
set this height as your term-buffer-maximum-size
@ymasory
ymasory / bay-scala-jobs
Last active February 18, 2020 20:48
Companies hiring Scala developers in the Bay Area.
Companies hiring Scala developers in the Bay Area.
Created in response to a thread on scala-base.
My favorites:
- CloudPhysics
- Wordnik
Unbiased list:
- 10Gen
- Audax Health
@kosmikus
kosmikus / TinyServant.hs
Created November 1, 2015 20:30
Implementation of a small Servant-like DSL
{-# LANGUAGE DataKinds, PolyKinds, TypeOperators #-}
{-# LANGUAGE TypeFamilies, FlexibleInstances, ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
module TinyServant where
import Control.Applicative
import GHC.TypeLits
import Text.Read
import Data.Time