Skip to content

Instantly share code, notes, and snippets.

@ErinCall
ErinCall / gist:8722020
Created January 30, 2014 23:04
Oh hey thanks
vagrant@precise64:~$ ghc --help
Usage:
ghc [command-line-options-and-input-files]
@ErinCall
ErinCall / gist:9621299
Created March 18, 2014 14:36
Excessive capistrano/cabal output

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 August 29, 2015 13:57
Simple site that doesn't actually run its splice
{-# LANGUAGE OverloadedStrings #-}
------------------------------------------------------------------------------
module Site
( app
) where
------------------------------------------------------------------------------
import Data.Monoid
import Snap.Snaplet
$ 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)
@ErinCall
ErinCall / gist:5c83fb58727f445ef747
Created January 23, 2015 23:34
Surprising JS error
<!DOCTYPE html>
<html>
<head>
<title>Surprising JS error</title>
</head>
<body>
<script type ="text/javascript">
var name = document.createElement("h1");
$ 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/
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 August 9, 2011 22:10
lexical scope in if-block in perl
§ 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.
@ErinCall
ErinCall / gist:1138231
Created August 10, 2011 20:54
{}.update
>>> foo = { 'a': 1, 'b': 2 }
>>> foo.update({'b': 444444, 'c': 3});
>>> foo
{'a': 1, 'c': 3, 'b': 444444}
@ErinCall
ErinCall / gist:1230967
Created September 21, 2011 01:37
ok so this probably isn't what I should be doing, but it definitely isn't what python should be doing
>>> 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