Skip to content

Instantly share code, notes, and snippets.

@bitc
bitc / init_darcs_in_git.sh
Created December 1, 2012 22:17
Use darcs to version control private files in a git repository
#!/bin/sh
# init_darcs_in_git.sh
#
# This is a script that initializes a darcs repository that can be used for
# managing private files in a git repository that should not be tracked by git
#
# The system is a simple hack, but it works quite elegantly in practice, darcs
# and git do not get in each others way.
#
@bitc
bitc / termview
Last active December 9, 2015 16:48
Opens a terminal window for viewing the output of a command. Useful with Vim for viewing the progress of a compilation or other external command, when run in silent mode.
#!/bin/bash
set -e
OUTPUT_PIPE=`mktemp -u`
STDOUT_SYNC=`mktemp -u`
STDERR_SYNC=`mktemp -u`
mkfifo $OUTPUT_PIPE $STDOUT_SYNC $STDERR_SYNC
exec > >(tee -a $OUTPUT_PIPE ; echo > $STDOUT_SYNC)
@bitc
bitc / cabal-fast-configure
Created December 29, 2012 08:19
A wrapper around the "cabal configure" command. It saves a hash of the configure arguments, and skips the actual configure if the arguments have not changed, thus shaving a few seconds off of your build time. Has support for hsenv. If you change your package database make sure to run "cabal-fast-configure --clean"
#!/bin/sh
set -e
if [ ! -f *.cabal ]
then
echo "You must run this script from the project root directory (where the .cabal file is)"
exit 2
fi
@bitc
bitc / Mac_OSX_Keyboard.md
Last active September 6, 2018 09:44
How I Configure Mac OS X Keyboard

How I configure Mac OS X Keyboard

Start Synergy Client on login

"System Preferences" -> "Users & Groups" -> "Login Options" -> Enable "Automatic Login"

Create the following script as ~/start_synergy.sh:

#!/bin/sh

#!/bin/sh
HOST=192.168.0.1
PORT=32000
(echo 'window.location.reload()' | nc $HOST $PORT) > /dev/null 2>&1 &
echo 'Browser Reload'
#!/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'
@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
@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
# ------------------------------------------------------------------------
# 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
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)