Skip to content

Instantly share code, notes, and snippets.

View gilbert's full-sized avatar
🪐
Security in space

Gilbert gilbert

🪐
Security in space
View GitHub Profile
@JosephLenton
JosephLenton / spider.pl
Created July 28, 2012 03:49
prolog text adventure game
/* SPIDER -- a sample adventure game, by David Matuszek.
Consult this file and issue the command: start. */
:- dynamic at/2, i_am_at/1, alive/1. /* Needed by SWI-Prolog. */
:- retractall(at(_, _)), retractall(i_am_at(_)), retractall(alive(_)).
/* This defines my current location. */
i_am_at(meadow).
@shaunxcode
shaunxcode / underscoreR.coffee
Created May 7, 2012 00:06 — forked from jimtla/underscoreR.coffee
Add CoffeeScript friendly kv args to Underscore.js
#names of functions to create KV versions of and arg lists (in order)
to_kv = throttle: ['func', 'wait'], delay: ['func', 'wait'], defer: ['func'], bind: ['func', 'context']
mixin = {}
for name, arglist of to_kv
do (name, arglist) ->
mixin["#{name}KV"] = (kvargs) ->
args = (kvargs[arg] for arg in arglist when kvargs[arg]?)
if arglist.length isnt args.length then throw new Error "missing args"
_[name](args...)
@austenito
austenito / integration_spec.rb
Created April 11, 2012 12:50
Integration Testing w/ Sorcery
describe "Shopping Cart Requests" do
let!(:user) { Fabricate(:user) }
before(:each) do
login_user_post("admin", "admin")
end
context "when I visit the shopping cart" do
it " show the logged in users' cart items " do
#Test stuff
@cmalven
cmalven / index.html
Last active October 30, 2025 12:24
Shortest (useful) HTML5 Document
<!-- http://www.brucelawson.co.uk/2010/a-minimal-html5-document/ -->
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>blah</title>
</head>
<body>
<p>I'm the content</p>
@beastaugh
beastaugh / CountLicenses.hs
Created April 26, 2011 20:31
Script to count how many different packages use particular licenses on Hackage.
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
{-
To use this script you need to extract your local Hackage index file. If
your setup is anything like mine, you should be able to find a .tar file
containing the listing somewhere like this:
~/.cabal/packages/hackage.haskell.org/00-index.tar.gz