Skip to content

Instantly share code, notes, and snippets.

View ab5tract's full-sized avatar

ab5tract ab5tract

  • Amsterdam, Netherlands
View GitHub Profile
# Framework
require 'foundations/compact'
# Gems
require 'palettes'
require 'cassandra'
# App
require 'views'
@ab5tract
ab5tract / wow ab5tract really IS the bomb
Created November 18, 2008 23:29
ab5tract really is the bomb
require 'rubygems'
require 'net/yail/IRCBot'
require 'hpricot' # For spitting out titles
require 'open-uri'
class Chewy < IRCBot
BOTNAME = 'Chewbotca'
BOTVERSION = '0.0.1'
# .zshrc
# Lines configured by zsh-newuser-install
HISTFILE=~/.zshd/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory extendedglob nomatch notify
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
def gcd(i1,i2)
( i2 == 0 ? i1 : gcd(i2, i1 % i2) )
end
id = lambda{|x| x}
eats = lambda{|x| eats }
module False
def self.require(str)
$:.each{|cur|
if File.directory?(cur)
pos = Dir.entries(cur)
if ((pos.include? "#{str}.rb") or (pos.include? str) or (pos.include? "#{str}.so"))
total = File.expand_path(str, cur)
unless $".include? total
load(total)
$" << total
codestr0m> Platform: 32-bit LSB 80386
<codestr0m> Default Library Path (ELF): /lib:/usr/lib (system default)
<codestr0m> Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
<codestr0m> Platform: 64-bit LSB AMD64
<codestr0m> Default Library Path (ELF): /lib/64:/usr/lib/64 (system default)
<codestr0m> Trusted Directories (ELF): /lib/secure/64:/usr/lib/secure/64 (system default)
<codestr0m> for the amd64 bits
<ab5tract> p4 2.0ghz
<codestr0m> /usr/lib/64' -> `amd64
class Default < Waves::Configurations::Default
attribute 'wikiroot'
wikiroot File.join ENV["HOME"], "wiki"
...
end
class Development < Default
# You get the idea ;)
@ab5tract
ab5tract / README
Created February 5, 2009 03:43 — forked from automatthew/README
Stop putting "require 'rubygems'" in your project files. Just madly require
away, assuming that whatever you need will be found in the load path.
Install dollarspots.rb early in your loadpath. It checks the pwd for a file
named .dollarspots.rb and loads it if found. Use .dollarspots.rb files locally
in projects to jigger with your loadpath such that your reckless requires
actually work. Note that this may involve saying "require 'rubygems'".
Call ruby with -rdollarspots, or set "rdollarspots" as your RUBYOPT. To get TextMate's RubyMate facilities to work you'll need to edit the RUBYOPT shell variable in the Prefs.
# This is my first attempt at p6, and I haven't coded perl since 2000, so be gentle ;)
use v6;
module WavesWorld {
use Waves <compact>;
# Taking advantage of roles and traits as opposed to the module mixin style utilized by Waves
class Map is Resource { # You can imagine roles here too: 'does Media', 'does Reload', etc.
# This is the simplest example, and doesn't pretend to provide the convenience of the Waves routing DSL...