Skip to content

Instantly share code, notes, and snippets.

View d11wtq's full-sized avatar

Chris Corbyn d11wtq

  • Melbourne, Australia
View GitHub Profile
@d11wtq
d11wtq / purcell-init-trace.el
Created September 24, 2011 14:38
Emacs 23 (Ubuntu 10.04) start error.
(string-prefix-p (file-name-as-directory (site-lisp-dir-for name)) f)
(and f (string-prefix-p (file-name-as-directory ...) f))
(let ((f ...)) (and f (string-prefix-p ... f)))
site-lisp-library-loadable-p(package)
(if (site-lisp-library-loadable-p name) nil (download-site-lisp-module name url))
(unless (site-lisp-library-loadable-p name) (download-site-lisp-module name url))
ensure-lib-from-url(package "http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp$
(if (> emacs-major-version 23) nil (ensure-lib-from-url (quote package) "http://repo.or.cz/w/emacs.git/blob_plain/1a$
(unless (> emacs-major-version 23) (ensure-lib-from-url (quote package) "http://repo.or.cz/w/emacs.git/blob_plain/1a$
;;; dwim-tab.el --- minor mode to force indentation when TAB would otherwise stall
; internal tracking variables
(setq dwim-tab-point-before nil)
(setq dwim-tab-point-after nil)
(defun dwim-tab ()
"Indents normally once, then switches to tab-to-tab-stop if invoked again.
Always performs tab-to-tab-stop if the first TAB press does not cause the
point to move."
;;; dwim-tab.el --- minor mode to force indentation when TAB would otherwise stall
(defun dwim-tab ()
"Indents normally once, then switches to tab-to-tab-stop if invoked again.
Always performs tab-to-tab-stop if the first TAB press does not cause the
point to move."
(interactive)
(when (or (eq last-command this-command)
(= (point) (progn
(indent-for-tab-command)
/home/chris/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:490:in `load_missing_constant': Expected /home/chris/flippa/flippa-rails/app/models/nda.rb to define Nda (LoadError)
from /home/chris/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:181:in `block in const_missing'
from /home/chris/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:179:in `each'
from /home/chris/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:179:in `const_missing'
from /home/chris/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0.rc2/lib/dm-core/support/ext/object.rb:25:in `block in full_const_get'
from /home/chris/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0.rc2/lib/dm-core/support/ext/object.rb:22:in `each'
from /home/chris/.rbenv/versions/1.9.2-p290/lib/ruby/g
class Message
include DataMapper::Resource
property :id, Serial
property :deleted, Boolean
belongs_to :sender,
'User'
belongs_to :recipient,
class CoercedArray < Array
def initialize(type)
super()
@type = type
end
def push(object)
object = @type.new(object) unless object.kind_of?(@type)
super
end
require "virtus"
class JsonModel
include Virtus
end
class Node < Virtus::Attribute::Object
attr_reader :type
class << self
class Message
include DataMapper::Resource
property :id, Serial
belongs_to :user
belongs_to :recipient, 'User', :child_key => [:recipient_id]
end
class User
require 'data_mapper'
# Add a logger, for debugging
DataMapper::Logger.new($stdout, :fatal)
# Add a convenience wrapper for debugging
module DataMapper
def self.debug
original_log_level = logger.level
logger.level = DataMapper::Logger::Levels[:debug]
source :rubygems
DM_VERSION = "~> 1.2.0"
gem "dm-core", DM_VERSION
gem "dm-serializer", DM_VERSION