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
(setq ruby-deep-indent-paren nil) | |
(defadvice ruby-indent-line (after unindent-closing-paren activate) | |
(let ((column (current-column)) | |
indent offset) | |
(save-excursion | |
(back-to-indentation) | |
(let ((state (syntax-ppss))) | |
(setq offset (- column (current-column))) | |
(when (and (eq (char-after) ?\)) | |
(not (zerop (car state)))) |
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
%li.reference_group | |
.container-fluid | |
.row-fluid | |
.span1.move | |
%i.icon-move | |
.span4 | |
= f.input_field :label_markdown, placeholder: '<markdown enabled>' | |
= f.input :order, as: :hidden | |
.span7 | |
= f.link_to_remove class: 'btn btn-danger' do |
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
# wraps third..+ paragraphs in div.more_content | |
# first two paragraphs are left in tack | |
def read_more_content html | |
first, second, *rest = Nokogiri::HTML::fragment(html).children | |
out = first.to_s + second.to_s | |
if rest.present? | |
out << "\n\n<div class=\"more_content\">" | |
out << rest.map(&:to_s).reduce(:+) | |
out << "</div>" | |
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
# renders markdown with footnotes matching Pandoc's syntax, | |
# but renders html with custom formatting in the class methods link_to_text_replace, link_to_fn_replace | |
class CatalogEntry | |
LINK_TO_FN = "[^%d] " | |
LINK_TO_TEXT = "[^%d]: %s" | |
CITATION = "%{last}, %{first}%{other}. \"%{title}.\" In _Bits & Pieces Put Together to Present a Semblance of a Whole: Walker Art Center Collections_, edited by Joan Rothfuss and Elizabeth Carpenter. Minneapolis, MN: Walker Art Center, 2005." | |
FILE_TEMPLATE = "B&Pcat-%{last},%{first}_2005" | |
FILE_NAME_REGEX = /B&Pcat-(.+),(.+)_2005.*/ |
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
# store the job before it has a chance to be served by dragonfly | |
images.configure do |c| | |
c.define_url do |app, job, opts| | |
thumb = ThumbTracker.where(job: job.serialize).first | |
unless thumb | |
uid = job.store | |
thumb = ThumbTracker.create!( | |
:uid => uid, | |
:job => job.serialize | |
) |
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 TileProcessor | |
def tile temp_object,tile_size=256 | |
geom = "#{tile_size}x#{tile_size}" | |
temf = Tempfile.open('o.ptif') | |
`convert #{temp_object.path} -define tiff:tile-geometry=#{geom} -compress jpeg 'ptif:#{temf.path}'` | |
temf | |
end | |
end | |
tiled_images.processor.register(TileProcessor) |
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 Artist | |
include Mongoid::Document | |
has_many :history_events, autosave: true, validate: true | |
end | |
class HistoryEvent | |
include Mongoid::Document | |
belongs_to :artist | |
validates_presence_of :headline |
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 PollStation | |
start: => @runner = setInterval @oneSecond, 50 | |
stop: => clearInterval(@runner) | |
runner: undefined | |
doOn: (num, func, args) => | |
$(document).on 'poll:oneSecond', (e, second, epochSecond) -> | |
if (epochSecond % num) == 0 | |
$(document.body).trigger("poll:#{num}Second") | |
func() | |
oneSecond: => |
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: APPLICATION | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start the APPLICATION unicorns at boot | |
# Description: Enable APPLICATION at boot time. | |
### END INIT INFO |
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
:indentation-update | |
(("with-bindings" . 1))) | |
(:return | |
(:ok | |
(("Unable to resolve symbol: break! in this context" " [Thrown class java.lang.RuntimeException]" nil) | |
(("QUIT" "Quit to the SLIME top level")) | |
((0 "[36m Util.java:156 clojure.lang.Util.runtimeException[39m" | |
(:restartable nil)) | |
(1 "[36m Compiler.java:6720 clojure.lang.Compiler.resolveIn[39m" | |
(:restartable nil)) |