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 DocumentSeries < ActiveRecord::Base | |
#... | |
# | |
# this returns an array of the free counter numbers in the series | |
# | |
def empty_series_counter_slots | |
(self.counter_start .. self.counter_current).to_a - self.documents.collect{|d| d.document_series_counter} | |
end |
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
- if @content_for_banner | |
= yield(:banner) |
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
#include in your model | |
#include Scopes | |
module Scopes | |
def self.included(base) | |
#scope for NOT IN | |
#usage: | |
# Model.not_in(1) | |
# Model.not_in(1,2,4) | |
# Model.not_in([1,2,4]) | |
# Model.not_in(1,2,3,[4,5,6]) |
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
#... | |
group :development do | |
gem 'mongrel', '>= 1.2.0.pre2' | |
gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache' | |
gem 'ruby-debug-base19x', '~> 0.11.30.pre4' | |
gem 'ruby-debug19' | |
end | |
#... |
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
#heart { | |
transform: rotate(45deg); | |
position: relative; | |
width: 250px; | |
height: 250px; | |
margin: 200px auto; | |
} | |
#heart div { |
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
#heart { | |
transform: rotate(45deg); | |
position: relative; | |
width: 250px; | |
height: 250px; | |
margin: 200px auto; | |
} | |
#heart div { |
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
#heart { | |
transform: rotate(45deg); | |
position: relative; | |
width: 250px; | |
height: 250px; | |
margin: 200px auto; | |
} | |
#heart div { |
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
<a | |
data-hover-actions="true" | |
data-hover-text="remove from favourites" | |
data-hover-class="ui button orange follow" | |
class="ui button green active follow" | |
href="/toggle_favourite" | |
> | |
<span class="icon"></span> | |
is one of your favourites | |
</a> |
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
/** | |
* Panel Styles | |
*/ | |
/*body_bg.png*/ | |
body{ background: url(http://i.imgur.com/9OqsE.png);} | |
body > div{ | |
margin-top:20px; | |
margin-left:20px; | |
min-height: 240px; | |
min-width: 240px; |
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
// taken from https://github.com/lokesh/color-thief | |
/* | |
CanvasImage Class | |
Class that wraps the html image element and canvas. | |
It also simplifies some of the canvas context manipulation | |
with a set of helper functions. | |
*/ | |
var CanvasImage = function(image){ | |
// If jquery object is passed in, get html element | |
this.imgEl = (image.jquery)? image[0]: image; |