This file contains 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
PGError: ERROR: column "showing_started_on" of relation "auctions" does not exist | |
: ALTER TABLE "auctions" DROP "showing_started_on" | |
=== \d auctions; | |
Table "public.auctions" | |
Column | Type | Modifiers | |
--------------------+-----------------------------+------------------------------------------------------- | |
id | integer | not null default nextval('auctions_id_seq'::regclass) | |
name | character varying(255) | not null | |
code | character varying(255) | |
This file contains 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 GroupByDrop << Liquid::Drop | |
def initialize(objects) | |
@objects = objects | |
end | |
def published_at_beginning_of_year_then_month | |
objects = ActiveSupport::OrderedHash.new | |
objects_by_year = @objects.group_by { |o| o.published_at.beginning_of_year } | |
objects_by_year.each do |time, objects_of_year| | |
objects[time] = objects_of_year.group_by { |o_year| o_year.published_at.beginning_of_month} |
This file contains 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
<div class="blog-archive"> | |
<h2>All entries</h2> | |
<ul id="blog-archive"> | |
{% for children_by_year_then_month in object.children.group_by.published_at_beginning_of_year_then_month %} | |
{% assign year = children_by_year[0] %} | |
{% assign children_by_months = children_by_year[1] %} | |
<li class="year" id="year_{{ year | date: "%Y" }}"> | |
{{ year | date: "%Y" }} | |
{% for children_by_month in children_by_months %} | |
{% assign month = children_by_month[0] %} |
This file contains 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
# HAML view | |
= f.text_area :javascript, :description => "Javascript typed here will come out in this page's javascript's section.", :rows => 20, :cols => 50, 'data-bespinoptions' => %q({ "syntax": "js" }).html_safe | |
# Output | |
<textarea cols="50" data-bespinoptions="{ "syntax": "js" }" description="Javascript typed here will come out in this page's javascript's section." id="page_javascript" name="page[javascript]" rows="20"></textarea> |
This file contains 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
$("#resize-image-dialog").dialog({ | |
autoOpen: false, | |
height: 300, | |
width: 350, | |
modal: false, | |
buttons: { | |
'Resize': function() { | |
var dataString = { | |
"width": $('#resize-image-dialog input#width').val(), | |
"height": $('#resize-image-dialog input#height').val() |
This file contains 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 PageDrop < Liquid::Drop | |
def initialize(page) | |
@page = page | |
end | |
def name | |
@page.name | |
end | |
def children |
This file contains 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 'dragonfly' | |
app = Dragonfly::App[:attachments] | |
if Rails.env == "production" | |
app.datastore = Dragonfly::DataStorage::S3DataStore.new | |
app.datastore.configure do |d| | |
d.bucket_name = 'xx' | |
d.access_key_id = 'xx' |
This file contains 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
0 /home/ramon/.rvm/gems/ruby-1.8.7-p302@rails2/gems/activesupport-2.3.8/lib/active_support/dependencies.rb 443 in `load_missing_constant' | |
1 /home/ramon/.rvm/gems/ruby-1.8.7-p302@rails2/gems/activesupport-2.3.8/lib/active_support/dependencies.rb 80 in `const_missing' | |
2 /home/ramon/.rvm/gems/ruby-1.8.7-p302@rails2/gems/activesupport-2.3.8/lib/active_support/dependencies.rb 92 in `const_missing' | |
3 /home/ramon/.rvm/gems/ruby-1.8.7-p302@rails2/gems/activesupport-2.3.8/lib/active_support/inflector.rb 364 in `constantize' | |
4 /home/ramon/.rvm/gems/ruby-1.8.7-p302@rails2/gems/activesupport-2.3.8/lib/active_support/inflector.rb 363 in `each' | |
5 /home/ramon/.rvm/gems/ruby-1.8.7-p302@rails2/gems/activesupport-2.3.8/lib/active_support/inflector.rb 363 in `constantize' | |
6 /home/ramon/.rvm/gems/ruby-1.8.7-p302@rails2/gems/activesupport-2.3.8/lib/active_support/core_ext/string/inflections.rb 162 in `constantize' | |
7 /home/ramon/.rvm/gems/ruby-1.8.7-p302@rails2/gems/actionpack-2.3.8/lib/action_controller/midd |
This file contains 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
(function($) { | |
$.fn.clippy = function(text, bgcolor) { | |
console.log("in clippy. I hope to copy this " + text + " after... "); | |
console.log($(this)); | |
var swf = "/jquery-plugins/clippy-0.0.1/clippy.swf" | |
if (!bgcolor) { | |
var node = $(this); | |
while (node.css('background-color') == 'transparent' && node.length) { | |
node = node.parent(); | |
} |
This file contains 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
$(function () { | |
/* Attachment form */ | |
$("form#new_attachment").ajaxForm({dataType: 'script'}); | |
$("form#new_attachment :file").change(function() { | |
var uploadId = new Date().getTime(); | |
$('#attachment-list').append('<li id="upload_id_' + uploadId + '">' + this.value + ' <span>(uploading...)</span></li>'); | |
$('form#new_attachment input#upload_id').val("upload_id_" + uploadId); | |
$(this).closest('form#new_attachment').submit(); | |
}); | |
}); |
OlderNewer