Skip to content

Instantly share code, notes, and snippets.

View quinn's full-sized avatar
🐁
huh

Quinn Shanahan quinn

🐁
huh
View GitHub Profile
require File.dirname(__FILE__) + '/../spec_helper'
describe 'a band\'s preferences' do
fixtures :groups, :users, :emails
before(:each) do
@band = groups(:pfunk)
@band.should be_is_a Band # pref definition is in band
@band.class.base_class.should == Group # base class is group
require 'rubygems'
require 'metaid'
o= Object.new
module Mixd
def sommeth
puts 'k'
end
;(function ($) {
$.fn.deletes = function () {
this.click(function () {
$.ajax({
success: function () {
this
.parents('.deletable:first').remove();
}.bind(this)
})
}).bind(this);
User < ActiveRecord::Record # thats right
has_many :comments
has_many :bands
def active_comments
comments.find :all do |c|
c.is_active == true
end
end
#!/usr/bin/env ruby
# super hacky git-export command
case ARGV.length
when 0
puts 'usage:'
puts "git-export [target] : defaults repository to CWD"
puts "git-export [repository] [target]"
exit 1
when 1
@quinn
quinn / whattech_menu.js
Created March 11, 2009 17:31
correct file extension is jsx, i changed it to js for syntax highlighting
preferences.rulerUnits = Units.PIXELS;
bgGrey = new SolidColor();
bgGrey.rgb.red = 255;
bgGrey.rgb.green = 255;
bgGrey.rgb.blue = 255;
backgroundColor = bgGrey;
var newDocumentRef = documents.add(89,36, 72.0, "Whattech Menu");
newDocumentRef = null;
Dir.glob('./**/*.erb').each do |dir|
new_dir = dir.sub( File.basename(dir), File.basename(dir).sub(/.erb$/, '.haml'))
`html2haml #{dir} #{new_dir}`
`rm #{dir}`
end
CFLAGS="-arch x86_64 -I/usr/local/php5/include/" LDFLAGS="-L/usr/local/php5/include/" './configure' '--disable-dependency-tracking' '--prefix=/usr/local/php5.3' '--with-apxs2=/usr/sbin/apxs' '--with-config-file-scan-dir=/usr/local/php5.3/php.d' '--with-openssl=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-ldap' '--with-xmlrpc' '--enable-exif' '--enable-soap' '--enable-sqlite-utf8' '--enable-wddx' '--enable-ftp' '--enable-sockets' '--with-bz2=/usr' '--enable-zip' '--enable-pcntl' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-memory-limit' '--enable-mbstring' '--enable-bcmath' '--with-libxml-dir=/usr/local/php5' '--with-xsl=/usr/local/php5' '--with-curl=shared,/usr/local/php5' '--with-png-dir=/usr/local/php5' '--with-freetype-dir=/usr/local/php5' '--with-mysql=shared,/usr/local/php5' '--with-mysqli=shared,/usr/local/php5/bin/mysql_config' '--with-pdo-mysql=shared,/usr/local/php5' '--with-pgsql=shared,/usr/local/php5' '--with-pdo-pgsql=shared,/usr/local/php5' '--wi
-enum {
- XT_CONNMARK_SET = 0,
- XT_CONNMARK_SAVE,
- XT_CONNMARK_RESTORE
+struct xt_connmark_info {
+ unsigned long mark, mask;
+ u_int8_t invert;
};
-struct xt_connmark_target_info {
@quinn
quinn / drupal.rb
Created April 21, 2009 16:24
working on a datamapper wrapper for a drupal database...
module Drupal
RepositoryName = :drupal
Repository = repository(Drupal::RepositoryName)
def self.common
"
include DataMapper::Resource
def self.default_repository_name
Drupal::RepositoryName