Skip to content

Instantly share code, notes, and snippets.

View larrytheliquid's full-sized avatar

Larry Diehl larrytheliquid

View GitHub Profile
Scenario Outline: filesystem setup
Then the <path> <type> exists
And the owner of <path> is the <user> user
And the group of <path> is the group of the <user> user
And the permissions for <path> are <permissions>
Scenarios: configuration
| type | permissions | user | path |
| file | 0644 | customer's | /data/nginx/nginx.conf |
| directory | 0775 | customer's | /data/nginx/ssl |
@larrytheliquid
larrytheliquid / env.rb
Created September 23, 2009 03:56
Reply to Cucumber Transform comment http://is.gd/3AqhI
def self.TokenTransform(token, pattern, &transform)
unless Kernel.const_defined? token
class << val = []
def to_s
"(#{Regexp.union(*self)})"
end
end
Kernel.const_set token, val
end
laptoptheliquid:~ larry$ brew install ghc
Error: RubyCocoa could not be loaded, therefore checking for spill is disabled.
When using a custom Ruby installation, you'll need to install RubyCocoa.
If this is not the case, see if the following ticket applies, or create one.
http://github.com/mxcl/homebrew/issues#issue/37
Warning: You should upgrade to Xcode 3.1.4
Warning: It appears you have Macports or Fink installed
Although, unlikely, this can break builds or cause obscure runtime issues.
If you experience problems try uninstalling these tools.
==> Downloading http://www.haskell.org/ghc/dist/current/dist/ghc-6.13.20100108-src.tar.bz2
# configure RubyGems to install into Homebrew's cellar
echo export GEM_HOME="$(brew --prefix)/Cellar/Gems/1.8" >> ~/.bash_profile
echo export GEM_PATH="$(brew --prefix)/Cellar/Gems/1.8:/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby/gems/1.8/gems" >> ~/.bash_profile
# configure RubyGems so it pings homebrew to update bin symlinks
gem install brewbygems
require 'rubygems'
require 'hubris' # best line ever
class Target
hubris :inline =>"triple::Int->Int; triple n = 3*n"
end
larrytheliquid@netbooktheliquid:~/src/testhubris$ Hubrify foo2.hs --module Bar --output foo2.bundle
Candidates: ["l"]
Language.Ruby.Hubris.wrap Bar.l (fromIntegral $ fromEnum $ Language.Ruby.Hubris.Binding.RUBY_Qtrue)
type of wrap.l is "Language.Ruby.Hubris.Binding.Value"
Exportable: ["l"]
{-# LANGUAGE ForeignFunctionInterface, ScopedTypeVariables #-}
module Language.Ruby.Hubris.Exports.Bar where
import Language.Ruby.Hubris
import qualified Prelude as P()
import Language.Ruby.Hubris.Binding
@larrytheliquid
larrytheliquid / Solve.oz
Created June 25, 2010 06:45
fun comparison between solving static Twelf indexed type family relations & dynamic Oz relational computation functions
% $Id: Solve.oz,v 1.1 2007/11/26 20:13:05 leavens Exp leavens $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Mozart System Supplements
% This file gives the extensions to the basic Mozart system that
% are used in the book "Concepts, Techniques, and Models of Computer
% Programming". The contents of this file can be put in the .ozrc
% file in your home directory, which will cause it to be loaded
% automatically when Mozart starts up.
module Decimal where
open import Data.Nat
infixr 5 _∷_
infixl 8 _^_
_^_ : ℕ → ℕ → ℕ
n ^ zero = 1
n ^ (suc m) = n * (n ^ m)
@larrytheliquid
larrytheliquid / my-plt-ish-books.txt
Created October 17, 2010 04:58
programming language theory: my current batch of books related to the topic, should help to get a feel of the basics
Mathematical Logic - Kleene
Basic Category Theory for Computer Scientists - Pierce
A Book of Abstract Algebra - Pinter
Conceptual Mathematics - Lawvere & Schanuel
An Introduction to Formal Logic - Smith
To Mock A Mockingbird - Smullyan
Introduction To Logic - Tarski
Purely Functional Data Structures - Okasaki
Topoi: The Categorial Analysis of Logic - Goldblatt
Lectures on the Curry-Howard Isomorphism - Sorensen, Urzyczyn
\usepackage[mathletters]{ucs}
\usepackage[utf8]{inputenc}