Skip to content

Instantly share code, notes, and snippets.

@ijt
ijt / io_quickcheck_example.hs
Created May 11, 2011 22:12
Simple example of monadic IO with QuickCheck in Haskell
#!/usr/bin/env runhaskell
-- Synopsis:
-- $ cabal install QuickCheck
-- $ runhaskell io_quickcheck_example.hs
--
-- Author: Issac Trotts <[email protected]>
import Directory
import System.Environment
@simonmichael
simonmichael / gist:1185421
Created September 1, 2011 03:59
ghc-pkg-clean, ghc-pkg-reset
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages.
# ghc-pkg-clean -f cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place.
@matope
matope / Dynamo: Amazonの高可用性Key-value Store.markdown
Last active November 18, 2022 17:54
Dynamo: Amazonの高可用性Key-value Store[和訳]
@jonathanjouty
jonathanjouty / installing-ghc7.6.1-osx10.8.md
Created October 17, 2012 11:24 — forked from beastaugh/installing-ghc7.2-osx10.7.md
Installing GHC 7.6.1 on Mac OS X 10.8 Mountain Lion

Installing GHC 7.6.1 on Mac OS X

This is a brief and bare-bones guide to getting GHC 7.6.1 and the cabal-install tool (the two basic things you'll need to do Haskell development) up and running on Mac OS X 10.8 install.

The instructions given here worked for me, but YMMV.

Original on https://gist.github.com/1169332

@lemoinem
lemoinem / ldap.conf
Last active June 15, 2016 07:01
Configurations needed to have sssd backed by an OpenLDAP with as-needed cache and OpenSSH support
base dc=ldap,dc=office
uri ldap://ldap.office
ssl start_tls
tls_cacert /etc/ssl/certs/CA.pem
@NicolasT
NicolasT / reconnect.hs
Created June 9, 2013 21:40
Auto-reconnecting Conduit sink with user-defined backoff
{-# LANGUAGE RankNTypes, OverloadedStrings #-}
module Main (main) where
import Control.Monad (guard)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Trans.Resource (register, release)
import Control.Exception (tryJust)
import GHC.IO.Exception
import Foreign.C.Error
@yuga
yuga / gist:8255552
Last active September 11, 2016 05:34

Haskellでバイナリデータ

1. はじめに

Haskellでバイナリファイルの読み書きをすることがこれまで何回かあったので、それをネタにアドベントカレンダーに参加したつもりだったのですが、定刻よりもだいぶ遅れての年始の到着となりました。申し訳ございません。これはHaskell Advent Calender 2013 11日目だったはずの記事です。明けましておめでとうございます。

さて。コンンピュータで扱うデータはすべてバイナリ形式で表現されています。したがってすべてはバイナリデータであるという言い方ができますが、しかし一般には、テキストでないデータをバイナリデータと呼びます。

Haskellにはバイナリデータを扱うライブラリがたくさんあります。どのライブラリも特別難しい要素があるわけでなく、Haskellのライブラリの中では扱いの容易な部類に含まれるものと思います。しかし、初めて取り組むときには、主要なライブラリのどれも同じようなインターフェイスを提供していることに、何を選べば良いか戸惑う人も多いのではないでしょうか。

@ah8r
ah8r / README.md
Last active June 7, 2020 19:51
Hut3 Cardiac Arrest (compatible with Python 2.7)

Cardiac Arrest

Hut3 Cardiac Arrest - A script to check OpenSSL servers for the Heartbleed bug (CVE-2014-0160).

Note: This code was originally a GitHub Gist but has been copied to a full GitHub Repository so issues can also be tracked. Both will be kept updated with the latest code revisions.

DISCLAIMER: There have been unconfirmed reports that this script can render HP iLO unresponsive. This script complies with the TLS specification, so responsitivity issues are likely the result of a bad implementation of TLS on the server side. CNS Hut3 and Adrian Hayter do not accept responsibility if this script crashes a server you test it against. USE IT AT YOUR OWN RISK. As always, the correct way to test for the vulnerability is to check the version of OpenSSL installed on the server in question. OpenSSL 1.0.1 through 1.0.1f are vulnerable.

This script has several advantages over similar scripts that have been re

@voluntas
voluntas / shiguredo_mqtt_gateway_log.rst
Last active November 26, 2017 12:11
時雨堂 MQTT ゲートウェイ Fuji 開発ログ
@voluntas
voluntas / mqtt.rst
Last active March 1, 2023 06:47
MQTT とはなんだったのか

MQTT とはなんだったのか

更新:2017-05-09
作者:@voluntas
バージョン:3.14
URL:http://voluntas.github.io/

MQTT をググって調べた人向け