Skip to content

Instantly share code, notes, and snippets.

def app
Rails::Application
end

DON'T START A FLAME WAR OVER THIS

This is just an off the cuff hack at something I'm interested in. Don't take it seriously, we all know about benchmarking.

Testing with CouchDB 1.0, OS X 10.6.4, Intel X-25M SSD

The list and view are as simple as can be:

// List

function(head, req) {

hg_ps1() {
hg prompt "{ on {branch}}{ at {bookmark}}{status}{ ↑{outgoing}}{outgoing|count}{ ↓{incoming}}{incoming|count}" 2> /dev/null
}
function parse_git_branch {
#[ -d .git ] || return 1
git_status="$(git status 2> /dev/null)"
branch_pattern="^# On branch ([^${IFS}]*)"
remote_pattern="# Your branch is (.*) of"
diverge_pattern="# Your branch and (.*) have diverged"
lstoll@linc ~ <master⚡> $ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *160.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS lincssd 159.7 GB disk0s2
3: Apple_Boot Boot OSX 134.2 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *640.1 GB disk1
@lstoll
lstoll / Gemfile
Created July 10, 2011 14:47
Fog storage example on Ninefold
source :rubygems
gem 'fog', :git => 'https://github.com/ninefold/fog.git', :branch => 'ninefold_storage'
#gem 'fog', :path => '/Users/lstoll/dev/ninefold/fog'
@lstoll
lstoll / server.sh
Created August 23, 2011 12:40
hacky way to run and mange a bunch of processes
#!/bin/bash
old_mongo_pid=`ps auxww | grep mongod | egrep -v grep | awk '{print $2}'`
# Start mongo and memcache if not running
ps aux | grep mongod | grep -v grep || mongod &
#ps aux | grep memcached | grep -v grep || memcached & pids="$pids $!"
if [ "$old_mongo_pid" == "" ]
then
echo "mongo wasnt running"
sleep 1
@lstoll
lstoll / JettyLauncher.scala
Created September 11, 2011 07:13
Scalatra on Heroku
/*
* Starts jetty for scalatra programatically
*
* Replace YourApplicationEndpointFilter with the filter in your application
*/
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.{DefaultServlet, ServletContextHandler}
object JettyLauncher {
def main(args: Array[String]) {
@lstoll
lstoll / gist:1213260
Created September 13, 2011 06:33
Play framework pulling modules directly from GitHub
## Sadly this doesn't work yet, because the github zipball includes the content in a sub dir, rather than the root dir.
## So you end up with: ls modules/scala-0.9.1/lstoll-play-scala-6290346/
# Application dependencies
require:
- play
- play -> crud
# Version number can be a tag or a branch
- com.github.playframework -> scala 0.9.1
@lstoll
lstoll / get_nab_account_balances.rb
Created February 6, 2012 13:50 — forked from wezm/get_nab_account_balances.rb
Update for current NAB IB
require 'rubygems'
require 'nokogiri'
require 'mechanize'
require 'logger'
module BankBalance
class NabFetcher
def fetch(client_number, password)
@lstoll
lstoll / pom.xml
Created March 12, 2012 03:57
A maven pom.xml that does nothing.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.lstoll</groupId>
<artifactId>nullpom</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>nullpom</name>