Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
# 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. |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008 | |
Compiled by Eric Pement - eric [at] pement.org version 0.27 | |
Latest version of this file (in English) is usually at: | |
http://www.pement.org/awk/awk1line.txt | |
This file will also be available in other languages: | |
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt | |
USAGE: |
# Requires a gem outside of Bundler. | |
# | |
# gem - the gem name | |
# const - only requires the gem if const is not yet defined | |
# | |
# Reference: https://gist.github.com/3894925 | |
def unbundled_require(*gems) | |
if defined?(::Bundler) | |
gems.each do |gem| | |
spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem}-*.gemspec").last |
# Print Git commit statistics for a specific author | |
# Usage: git-stats "Linus Torvalds" | |
git-stats() { | |
author=${1-`git config --get user.name`} | |
echo "Commit stats for \033[1;37m$author\033[0m:" | |
git log --shortstat --author $author -i 2> /dev/null \ | |
| grep -E 'files? changed' \ | |
| awk 'BEGIN{commits=0;inserted=0;deleted=0} \ | |
{commits+=1; if($5!~"^insertion") { deleted+=$4 } \ |
#!/usr/local/bin/runhaskell | |
{- | |
DECPRECATED - Currently cabal repl provides a much better solution to this problem. | |
Use this script as a "replacement" for the ghci interpreter to | |
automatically include extensions from your cabal file. | |
Be sure to set the cabalFile and (optionally) ghciInit values in this script. | |
You may also need to update the bang line to the path of runhaskell. |
// Reloading modules from the repl in Node.js | |
// Benjamin Gleitzman (gleitz@mit.edu) | |
// | |
// Inspired by Ben Barkay | |
// http://stackoverflow.com/a/14801711/305414 | |
// | |
// Usage: `node reload.js` | |
// You can load the module as usual | |
// var mymodule = require('./mymodule') | |
// And the reload it when needed |
# 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. |