Skip to content

Instantly share code, notes, and snippets.

View wfarr's full-sized avatar
:shipit:
shipping

Will Farrington wfarr

:shipit:
shipping
View GitHub Profile
(defun gist-language ()
"Sniffs for the language of the region that is being pasted"
(or (when (boundp 'rails-view-minor-mode) (if rails-view-minor-mode ".rhtml"))
(when (boundp 'rails-minor-mode) (if rails-minor-mode ".rhtml"))
(cdr (assoc major-mode '((c-mode . ".c")
(c++-mode . ".cpp")
(css-mode . ".css")
(diff-mode . ".diff")
(erlang-mode . ".erl")
(haskell-mode . ".hs")
(defun gist-language ()
"Sniffs for the language of the region that is being pasted"
(or (when (boundp 'rails-view-minor-mode) (if rails-view-minor-mode ".rhtml"))
(when (boundp 'rails-minor-mode) (if rails-minor-mode ".rhtml"))
(cdr (assoc major-mode '((c-mode . ".c")
(c++-mode . ".cpp")
(css-mode . ".css")
(diff-mode . ".diff")
(erlang-mode . ".erl")
(haskell-mode . ".hs")
@wfarr
wfarr / success
Created September 23, 2008 03:41
puts "Success"
;; Some work to make gist.el use some of the new api goodness
;; Non-working, atm
(defun gist-region (begin end)
"Post the current region as a new paste at gist.github.com
Copies the URL into the kill ring."
(interactive "r")
(let* ((file (or (buffer-file-name) (buffer-name)))
(name (file-name-nondirectory file))
(ext (or (cdr (assoc major-mode gist-supported-modes-alist))
;; gist.el --- Emacs integration for gist.github.com
;; Copyright (C) 2008 Christian Neukirchen <purl.org/net/chneukirchen>
;; Copyright (C) 2008 Chris Wanstrath <[email protected]>
;; Copyright (C) 2008 Will Farrington <[email protected]>
;; Licensed under the same terms as Emacs.
;; Version: 0.3.1
;; 26aug2008 +wfarr+
;; 25aug2008 +defunkt+
;; 21jul2008 +chris+
(get-github-user-info)
(def
(get-github-user-info)
(defvar foo "foo")
(defv
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in `const_missing': uninitialized constant RedCloth::TextileDoc::BASIC_TAGS (NameError)
from /home/wfarrington/nex3-s-blog-engine/lib/codecloth.rb:17:in `included'
from /usr/lib/ruby/gems/1.8/gems/RedCloth-4.0.3/lib/redcloth.rb:27:in `include'
from /usr/lib/ruby/gems/1.8/gems/RedCloth-4.0.3/lib/redcloth.rb:27:in `send'
from /usr/lib/ruby/gems/1.8/gems/RedCloth-4.0.3/lib/redcloth.rb:27:in `include'
from /home/wfarrington/nex3-s-blog-engine/lib/codecloth.rb:91:in `send'
from /home/wfarrington/nex3-s-blog-engine/lib/codecloth.rb:91
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
... 32 levels...
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:493:in `const_missing': uninitialized constant ApplicationController::Nex3 (NameError)
from /home/wfarrington/nex3-s-blog-engine/app/controllers/application.rb:4
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.r
class Post
include DataMapper::Resource
property :id, Serial
property :title, String
property :content, Text
property :tags, String
property :slug, String
property :created_at, DateTime
property :updated_at, DateTime