Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'trac4r'
require 'active_record'
TIME_FILE = "/var/tmp/mpwa-sync"
NEW_PORTS = "/Users/joe/Dev/gsoc10-mpwa/bin/new-ports"
PORT_INDEX = "/opt/local/var/macports/sources/rsync.macports.org/release/ports"
RAILS_ROOT = "/Users/joe/Dev/gsoc10-mpwa/mpwa"
require File.expand_path(RAILS_ROOT + '/app/models/category.rb', __FILE__)
#!/usr/bin/env ruby
require 'trac4r'
require 'active_record'
TIME_FILE = "/var/tmp/mpwa-sync"
NEW_PORTS = "/Users/joe/Dev/gsoc10-mpwa/bin/new-ports"
PORT_INDEX = "/opt/local/var/macports/sources/rsync.macports.org/release/ports"
RAILS_ROOT = "/Users/joe/Dev/gsoc10-mpwa/mpwa"
OPEN_STATUSES = ['new', 'reopened', 'assigned']
db_info = YAML.load_file(File.expand_path(RAILS_ROOT + '/config/database.yml', __FILE__))
#!/usr/bin/env ruby
require 'trac4r'
require 'active_record'
TIME_FILE = "/var/tmp/mpwa-sync"
NEW_PORTS = "/Users/joe/Dev/gsoc10-mpwa/bin/new-ports"
PORT_INDEX = "/opt/local/var/macports/sources/rsync.macports.org/release/ports"
RAILS_ROOT = "/Users/joe/Dev/gsoc10-mpwa/mpwa"
OPEN_STATUSES = ['new', 'reopened', 'assigned']
db_info = YAML.load_file(File.expand_path(RAILS_ROOT + '/config/database.yml', __FILE__))
class Port < ActiveRecord::Base
has_many :port_dependencies
has_many :dependencies, :through => :port_dependencies
has_many :comments
has_many :tickets
has_one :category
belongs_to :category
def self.search(criteria, val, page)
paginate :per_page => 50, :page => page, :conditions => ["#{self.columns_hash[criteria].name} like ?", "%#{val}%"], :order => 'name ASC'
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <mach/mach_init.h>
#include <mach/mach_types.h>
#include <mach/x86_64/task.h>
#include <mach/x86_64/thread_act.h>
#include <mach/mach_traps.h>
void print_usage(char *);
##############################################################################
#
# Hidden license
#
# By reading the source code of this file, you're automatically agreeing
# with the following conditions:
#
# 1. You will sell your soul to us for $0.
# 2. You will watch the movie "Hot Fuzz".
#
5.times {|x| puts x}
5.times do |x|
puts x
end
func = lambda {|x| puts x}
5.times {|x| func.call(x)}
source 'http://rubygems.org'
gem 'rails', '3.0.0'
gem 'recaptcha', :require => "recaptcha/rails"
gem 'will_paginate', '3.0.pre2'
group :development, :test do
gem 'sqlite3'
end
#!/bin/bash
export PATH=$HOME/bin:/Developer/usr/bin:/opt/local/bin:/opt/local/sbin:$PATH
export LC_CTYPE=en_US.UTF-8
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
#prompt
@jrozner
jrozner / .vimrc
Created September 23, 2010 22:15
"Load Bunldes with Pathogen
call pathogen#runtime_append_all_bundles()
" Auto Commands
if has("autocmd")
" enable filetype detection
filetype plugin indent on
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |