Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
find $1 -name '*.hs' | sed "s%$1%%" | sed 's/\.hs/,/' | sed 's%/%\.%g'
@bitc
bitc / hdevtools-stack.md
Last active January 22, 2018 14:42
Using hdevtools "classic" with stack

Hardcore way of using "classic" version of hdevtools with stack.

First build and install the "classic" version of hdevtools, using stack:

$ cd /tmp
$ git clone --depth 1 https://github.com/bitc/hdevtools.git
$ cd hdevtools
# Modify the flags in the following line to use the same settings you use in your project:
$ stack --install-ghc --no-system-ghc --resolver lts-7.1 init

$ stack install

name: test
version: 0.1.0.0
license: BSD3
license-file: LICENSE
author: captain
maintainer: <>
build-type: Simple
extra-source-files: ChangeLog.md
cabal-version: >=1.10
@bitc
bitc / export_github_issues.py
Created May 23, 2016 11:34
Export GitHub issues of a single repository (including comments) to JSON file
import requests
import json
GITHUB_USER = ''
GITHUB_PASSWORD = ''
REPO = '' # format is username/repo
ISSUES_FOR_REPO_URL = 'https://api.github.com/repos/%s/issues?state=all' % REPO
import Data.IORef
import Test.QuickCheck
import Test.QuickCheck.Monadic
data Queue a = Queue (IORef [a])
empty :: IO (Queue a)
empty = do
ref <- newIORef []
return (Queue ref)
# vim: ts=2 sw=2 sts=2 et:
containers:
dev:
setup:
- !Ubuntu trusty
- !BuildDeps [software-properties-common]
- !Sh |
add-apt-repository -y ppa:hvr/ghc
@bitc
bitc / gist:14087883c926ec97011f
Last active December 22, 2020 07:02
vagga build snippets
# All build snippets are based on Ubuntu trusty:
containers:
build:
setup:
- !Ubuntu trusty
- !UbuntuUniverse
# ------------------------------------------------------------------------
@bitc
bitc / build.sh
Last active August 29, 2015 14:20
Build wrapper script for Shake
#!/bin/sh
# This script assumes that Build.hs is the only build script (it should not
# import any other local files)
set -e
if [ ! _shake/build -nt Build.hs ]; then
mkdir -p _shake || exit 1
ghc --make Build.hs -rtsopts -with-rtsopts=-I0 -outputdir=_shake -o _shake/build || exit 1
#!/usr/bin/env ruby
# Requires that Google Chrome be started with:
# $ chromium-browser --remote-debugging-port=9222
# Uses this library: https://github.com/fgalassi/chrome-remote-debug
require 'rubygems'
require 'chrome_remote_debug'
#!/bin/sh
HOST=192.168.0.1
PORT=32000
(echo 'window.location.reload()' | nc $HOST $PORT) > /dev/null 2>&1 &
echo 'Browser Reload'