Public Gists by myobie

Gravatar
Thu Nov 12 13:04:29 -0800 2009
1
2
3
var search_label = "";
 
$(function() {
Gravatar
Mon Nov 09 17:49:20 -0800 2009
1
2
3
  def path(style = nil)
    if style.nil?
      super()
Gravatar
Fri Nov 06 09:01:53 -0800 2009
1
2
3
class Merb::Controller
  def partial(template, opts = {})
    if template.is_a?(Array)
Gravatar
Thu Nov 05 10:53:46 -0800 2009
1
2
3
Book.all :conditions => ["user_id = ? OR assigned_user_id = ? OR id IN (SELECT book_id FROM subscriptions WHERE user_id = ?)", id, id, id], :unique => true, :order => [:created_at.desc]
 
__END__
Gravatar
Wed Nov 04 08:41:09 -0800 2009
1
2
3
~ (0.000284) SELECT `id`, `number`, `title`, `status`, `stack_id` FROM `tickets` WHERE ... GROUP BY `id`, `number`, `title`, `status`, `stack_id` ORDER BY `created_at` DESC
 
 ~ (0.000189) SELECT `stack_id` FROM `tickets` WHERE ... GROUP BY `stack_id`
Gravatar
Thu Oct 29 18:20:10 -0700 2009
1
2
3
require 'logger'
 
module Spawn
Gravatar
Wed Oct 28 09:43:55 -0700 2009
1
2
3
require "rubygems"
 
# Add the local gems dir if found within the app root; any dependencies loaded
Gravatar
Tue Oct 27 12:08:21 -0700 2009
1
2
3
require 'rubygems'
require 'dm-core'
 
Gravatar
Mon Oct 26 14:19:52 -0700 2009
1
2
3
class FieldSet
  include DataMapper::Resource
  
Gravatar
Mon Oct 26 09:17:47 -0700 2009
1
2
3
From: nathan@myobie.com
To: support+myobie@ticketsapp.com
Subject: Email is down?! [priority: high] [stack: web]
Gravatar
Fri Oct 23 12:52:09 -0700 2009
1
2
3
  should "package up a query to be run later" do
    DataMapper.auto_migrate!
    a = Account.gen(:name => "foo")
Gravatar
Thu Oct 22 17:10:45 -0700 2009
1
2
3
puts Book.all(:author => Author.all).query.to_json
 
# {"model":"Book","repository":"default","conditions":{"and":[{"in":{"Book.author":{"collection":{"model":"Author","repository":"default","conditions":{"null":[]},"reload":false,"order":["Author.id.asc"],"fields":["Author.id","Author.name","Author.place_id"],"links":[],"unique":false,"limit":null,"offset":0}}}}]},"reload":false,"order":["Book.id.asc"],"fields":["Book.id","Book.title","Book.author_id"],"links":[],"unique":false,"limit":null,"offset":0}
Gravatar
Thu Oct 22 08:56:44 -0700 2009
1
2
3
puts Ticket.select { |t|
  t.title == "foo" || (t.user_id == 6 && t.account_id == 9)
}.query.to_json
Gravatar
Thu Oct 22 07:55:40 -0700 2009
1
2
3
{
  "fields": [],
  "conditions": {
Gravatar
Tue Oct 20 11:32:20 -0700 2009
1
2
3
require File.dirname(__FILE__) + '/../spec_helper'
 
class LocalInbox
Gravatar
Mon Oct 19 18:23:56 -0700 2009
1
2
postmaster@example.com postmaster
@example.com nathan
Gravatar
Mon Oct 19 13:13:38 -0700 2009
1
2
3
Oct 19 16:13:53 Nue-Hotness postfix/master[34055]: daemon started -- version 2.6.5, configuration /etc/postfix
Oct 19 16:13:53 Nue-Hotness postfix/qmgr[34057]: B88DF18AF63D: from=<nathan@Nue-Hotness.local>, size=367, nrcpt=1 (queue active)
Oct 19 16:13:53 Nue-Hotness postfix/master[34055]: warning: process /usr/libexec/postfix/trivial-rewrite pid 34059 exit status 1
Gravatar
Sat Oct 17 07:36:35 -0700 2009
1
2
3
require 'dm-core'
 
module DataMapper
Gravatar
Fri Oct 16 12:52:20 -0700 2009
1
2
3
>> Merb::BootLoader.gem_environment.instance_eval { gem "merb-core", "1.0.10" }
Gem::LoadError: RubyGem version error: merb-core(1.1 not = 1.0.10)
 
Gravatar
Thu Oct 15 08:29:08 -0700 2009
1
2
3
ArgumentError: wrong number of arguments
from /Library/Ruby/Gems/1.8/gems/merb-mailer-1.1/lib/merb-mailer/mailer.rb:82:in `test'
from /Library/Ruby/Gems/1.8/gems/merb-mailer-1.1/lib/merb-mailer/mailer.rb:82:in `send'