Skip to content

Instantly share code, notes, and snippets.

Avatar

Larry Diehl larrytheliquid

View GitHub Profile
View regex_of_doom.rb
"the /data/nginx/servers/:application.rewrites for the customer's application file exists" =~ /^the ((?:\w+|\/|\.|-|~|:)+(?:for the \S+ application)?) file exists$/
View filesystem.feature
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 Sep 23, 2009
Reply to Cucumber Transform comment http://is.gd/3AqhI
View env.rb
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
View failed_homebrew_configure.sh
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
View gist:273125
# 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
View test.rb
require 'rubygems'
require 'hubris' # best line ever
class Target
hubris :inline =>"triple::Int->Int; triple n = 3*n"
end
View gist:275766
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 Jun 25, 2010
fun comparison between solving static Twelf indexed type family relations & dynamic Oz relational computation functions
View Solve.oz
% $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.
View Decimal.agda
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 Oct 17, 2010
programming language theory: my current batch of books related to the topic, should help to get a feel of the basics
View my-plt-ish-books.txt
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
You can’t perform that action at this time.