Skip to content

Instantly share code, notes, and snippets.

View bjeanes's full-sized avatar
🕊️

Bo Jeanes bjeanes

🕊️
View GitHub Profile
@gus
gus / index.txt
Created November 30, 2009 21:55 — forked from toothrot/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@rcmachado
rcmachado / html5.vim
Created December 15, 2009 10:35
Vim syntax file for HTML 5
" Vim syntax file
" Language: HTML (version 5)
" Maintainer: Rodrigo Machado <rcmachado@gmail.com>
" URL: http://gist.github.com/256840
" Last Change: 2010 Aug 26
" License: Public domain
" (but let me know if you liked it :) )
"
" Note: This file just adds the new tags from HTML 5
" and don't replace default html.vim syntax file
~/projects/jruby/tmp ➔ jruby -e "\$: << '../../maven_gem/lib'; require 'pom2gem.rb'; MavenGem::PomSpec.from_url('http://mirrors.ibiblio.org/pub/mirrors/maven2/org/clojure/clojure/1.0.0/clojure-1.0.0.pom')"
~/projects/jruby/tmp ➔ ls -l *.gem
-rw-r--r-- 1 headius staff 1372160 Dec 17 00:18 org.clojure.clojure-1.0.0-java.gem
~/projects/jruby/tmp ➔ gem install org.clojure.clojure-1.0.0-java.gem
Successfully installed org.clojure.clojure-1.0.0-java
1 gem installed
Installing ri documentation for org.clojure.clojure-1.0.0-java...
Installing RDoc documentation for org.clojure.clojure-1.0.0-java...
@lilyball
lilyball / fnmatch.go
Created January 9, 2010 04:16
fnmatch implementation for Go
// Provide string-matching based on fnmatch.3
package fnmatch
// There are a few issues that I believe to be bugs, but this implementation is
// based as closely as possible on BSD fnmatch. These bugs are present in the
// source of BSD fnmatch, and so are replicated here. The issues are as follows:
//
// * FNM_PERIOD is no longer observed after the first * in a pattern
// This only applies to matches done with FNM_PATHNAME as well
// * FNM_PERIOD doesn't apply to ranges. According to the documentation,
#!/bin/bash
read -p "Enter in part of public ssh key to search: " key
for f in `cut -d : -f 6 /etc/passwd`; do grep -nHs $key $f/.ssh/authorized_keys; done;
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
When /^(.*) in the "([^\"]*)" section$/ do |action, title|
within "//*[(h1|h2|h3|h4|h5|h6|legend|caption)/descendant-or-self::*[contains(text(), '#{title}')]]" do
When action
end
end
When /^(.*) in the "([^\"]*)" row$/ do |action, title|
within "//*[(th|td)/descendant-or-self::*[contains(text(), '#{title}')]]" do
When action
end
# Rack::SimpleServer
#
# a small rack app that acts like a basic HTTP server
# github.com/chendo
#
# Options:
# * :root => directory to expose
# e.g., use Rack::SimpleServer, :root => 'pub'
module Rack
@ion1
ion1 / rtorrent.rc
Created April 22, 2010 20:40
rtorrent.rc
# http://libtorrent.rakshasa.no/wiki/RTorrentRatioHandling
ratio.enable =
ratio.min.set = 200
ratio.max.set = 0
ratio.upload.set = 0
system.method.set = group.seeding.ratio.command, d.close=, d.erase=
# Link when finished.
system.method.set_key = event.download.finished, link_finished, "execute = mkdir, -p, ../done; execute = cp, -al, --, $d.get_base_path=, ../done/"
@lepinkainen
lepinkainen / rtorrent.rc
Created April 25, 2010 22:37 — forked from ion1/rtorrent.rc
rtorrent finished events
# http://libtorrent.rakshasa.no/wiki/RTorrentRatioHandling
# Ratio 2.0, close & erase when done - erasing deletes torrents from rtorrent
ratio.enable =
ratio.min.set = 200
ratio.max.set = 0
ratio.upload.set = 0
system.method.set = group.seeding.ratio.command, d.close=, d.erase=
# On completion, move the torrent to the directory from custom1.