This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Message | |
include DataMapper::Resource | |
property :id, Serial | |
property :deleted, Boolean | |
belongs_to :sender, | |
'User' | |
belongs_to :recipient, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CoercedArray < Array | |
def initialize(type) | |
super() | |
@type = type | |
end | |
def push(object) | |
object = @type.new(object) unless object.kind_of?(@type) | |
super | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "virtus" | |
class JsonModel | |
include Virtus | |
end | |
class Node < Virtus::Attribute::Object | |
attr_reader :type | |
class << self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Message | |
include DataMapper::Resource | |
property :id, Serial | |
belongs_to :user | |
belongs_to :recipient, 'User', :child_key => [:recipient_id] | |
end | |
class User |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
DM_VERSION = "~> 1.2.0" | |
gem "dm-core", DM_VERSION | |
gem "dm-serializer", DM_VERSION |