Skip to content

Instantly share code, notes, and snippets.

View gist:8722020
vagrant@precise64:~$ ghc --help
Usage:
ghc [command-line-options-and-input-files]
@ErinCall
ErinCall / gist:9621299
Created Mar 18, 2014
Excessive capistrano/cabal output
View gist:9621299

This is a subset of the output of cap production deploy. I have a simple task that compiles my app with Cabal:

namespace :deploy do
  task :compile do
    on roles(:all) do
      within release_path do
        execute 'cabal', 'update'
        execute 'cabal', 'sandbox', 'init'
        execute 'cabal', 'install', '--only-dependencies', '--force-reinstall', '--verbose=0', '-O2'
@ErinCall
ErinCall / Site.hs
Last active Aug 29, 2015
Simple site that doesn't actually run its splice
View Site.hs
{-# LANGUAGE OverloadedStrings #-}
------------------------------------------------------------------------------
module Site
( app
) where
------------------------------------------------------------------------------
import Data.Monoid
import Snap.Snaplet
View gist:7642036530b126ab96ae
$ snap init
$ cabal sandbox init
Writing a default package environment file to
/Users/andrewlorente/code/escaping_bug_demo/cabal.sandbox.config
Creating a new sandbox at
/Users/andrewlorente/code/escaping_bug_demo/.cabal-sandbox
$ cabal install --only-dependencies
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: escapingbugdemo-0.1 (user goal)
View gist:5c83fb58727f445ef747
<!DOCTYPE html>
<html>
<head>
<title>Surprising JS error</title>
</head>
<body>
<script type ="text/javascript">
var name = document.createElement("h1");
View gist:44198bfd8df6ca3b843b
$ cargo build
Compiling grim-edit v0.0.1 (file:///Users/erincalling/code/grim-edit)
error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/usr/local/Cellar/rust/1.0.0/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/erincalling/code/grim-edit/target/debug/grim_edit" "/Users/erincalling/code/grim-edit/target/debug/grim_edit.o" "-Wl,-force_load,/usr/local/Cellar/rust/1.0.0/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a" "-Wl,-dead_strip" "-nodefaultlibs" "/Users/erincalling/code/grim-edit/target/debug/deps/libkiss_ui-3b13f82488719214.rlib" "/Users/erincalling/code/grim-edit/target/debug/deps/libiup_sys-4a23062e27aae405.rlib" "/Users/erincalling/code/grim-edit/target/debug/deps/liblibc-ef5cbad4ef5c7a1e.rlib" "/usr/local/Cellar/rust/1.0.0/lib/rustlib/x86_64-apple-darwin/lib/libstd-4e7c5e5c.rlib" "/usr/local/Cellar/rust/1.0.0/lib/rustlib/x86_64-apple-darwin/lib/libcollections-4e7c5e5c.rlib" "/usr/local/Cellar/rust/1.0.0/lib/rustlib/x86_64-apple-darwin/lib/libunicode-4e7c5e5c.rlib" "/usr/local/
View gist:e9e533390da8d5cdf813
Return-Path: <bounces+1693553-3397-hello=erincall.com@job.agentrainjobs.com>
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
by sloti36d2t33 (Cyrus 3.0.0-beta1-git-fastmail-11686) with LMTPA;
Wed, 02 Sep 2015 19:02:43 -0400
X-Sieve: CMU Sieve 2.4
X-Spam-score: 0.0
X-Spam-hits: BAYES_20 -0.001, HTML_MESSAGE 0.001, RCVD_IN_DNSWL_NONE -0.0001,
SPF_PASS -0.001, T_RP_MATCHES_RCVD -0.01, LANGUAGES en,
BAYES_USED global, SA_VERSION 3.3.2
X-Spam-source: IP='198.21.7.235', Host='o1.job.agentrainjobs.com', Country='US',
@ErinCall
ErinCall / gist:1135337
Created Aug 9, 2011
lexical scope in if-block in perl
View gist:1135337
§ perl
use strict;
if (0) {
my $foo = 'albertsons';
}
print "->$foo<-"
Global symbol "$foo" requires explicit package name at - line 5.
Execution of - aborted due to compilation errors.
View gist:1138231
>>> foo = { 'a': 1, 'b': 2 }
>>> foo.update({'b': 444444, 'c': 3});
>>> foo
{'a': 1, 'c': 3, 'b': 444444}
@ErinCall
ErinCall / gist:1230967
Created Sep 21, 2011
ok so this probably isn't what I should be doing, but it definitely isn't what python should be doing
View gist:1230967
>>> def foo(bar=None):
... def baz():
... if not bar: bar = 'goo'
... print bar
... baz()
...
>>> foo()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 5, in foo