Skip to content

Instantly share code, notes, and snippets.

withResource pool (\_ -> do
logError "gave a resource"
pass
logError "took back the resource"
)
withResourceSnap :: Pool a -> (a -> Handler b v c) -> Handler b v c
withResourceSnap pool act = bracketHandler (takeResource pool) putResource' runAction
where runAction (a,b) = act a
putResource' (a,b) = putResource b a
class Responder a where
respond :: a -> Controller ()
class Injectable a where
inject :: Controller (Maybe a)
instance (Injectable a, Responder b) => Responder (a -> b) where
respond f = do
a <- inject
case a of
ExUnit.start
defmodule MacroExpansionTest do
use ExUnit.Case
defmacro a_macro(_) do
quote do
1 + 1
end
end
beepity-boo-bop:code $ cd ../../
beepity-boo-bop:src $ cd ..
beepity-boo-bop:Downloads $ open disruptor-master.zip
beepity-boo-bop:Downloads $ cd disruptor-master/
beepity-boo-bop:disruptor-master $ ./gradlew tasks
Downloading http://services.gradle.org/distributions/gradle-1.2-bin.zip
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
set nocompatible
filetype off
silent! call pathogen#runtime_append_all_bundles()
silent! call pathogen#helptags()
filetype plugin indent on
runtime macros/matchit.vim
set hidden
set autoread
set nobackup
# kern.sysv.shm* settings added by MagLev installation
kern.sysv.shmmax=2147483648
kern.sysv.shmall=524288
kern.sysv.shmmin=1
kern.sysv.shmmni=32
kern.sysv.shmseg=8
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
; fails
(defn calls-callback [callback]
(fn [thing] (callback thing)))
(defn callback [a] (print a))
(fact "calls-callback can be mocked to check the callback is called"
(let [closed (calls-callback callback)]
(closed 1) => anything
sudo rm -rf /Library/Frameworks/GHC.framework
sudo rm -rf /Library/Frameworks/HaskellPlatform.framework
sudo rm -rf /Library/Haskell
rm -rf .cabal
rm -rf .ghc
rm -rf ~/Library/Haskell
find /usr/bin /usr/local/bin -type l | \
xargs -If sh -c '/bin/echo -n f /; readlink f' | \
egrep '//Library/(Haskell|Frameworks/(GHC|HaskellPlatform).framework)' | \
cut -f 1 -d ' ' > /tmp/hs-bin-links