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 PagesController < ApplicationController | |
before_filter :authenticate | |
caches_page :home, :privacy | |
# Show the home page. | |
def home; end | |
# Show the privacy policy page. |
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
.isotope.no-transition, | |
.isotope.no-transition .isotope-item, | |
.isotope .isotope-item.no-transition { | |
-webkit-transition-duration: 0s; | |
-moz-transition-duration: 0s; | |
transition-duration: 0s; | |
} |
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 'yaml' | |
asset_path = File.expand_path(File.dirname(__FILE__) + '/../lib/assets/content/') | |
assets = Dir.glob(asset_path + '/*.yml') | |
assets.each do |url| | |
key = File.basename(url, '.yml') | |
parsed = YAML.load_file(url) | |
if parsed | |
klass = Admin.const_get(key.classify) |
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
module AdminHelper | |
def link_to_direction(field, title = nil) | |
title ||= field.humanize | |
dir = @order_dir.downcase == 'asc' ? 'desc' : 'asc' | |
link_to title, yield(:order => field, :dir => dir) if block_given? | |
end | |
end | |
= link_to_direction('name') {|params| admin_artists_path(params)} |
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 Result < ActiveRecord::Base | |
class << self | |
def past_week_span(date = nil) | |
date ||= Date.today | |
(date.beginning_of_week...date.beginning_of_week + 7).collect do |date| | |
date.day | |
end | |
end | |
end | |
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
SELECT | |
EXTRACT(DAY FROM created_at) AS the_day, | |
COUNT(created_at) AS count_all | |
FROM "results" | |
WHERE "results"."result_type" = 'outcome' | |
AND (DATE("results"."created_at") BETWEEN '2011-11-21' AND '2011-12-01') | |
GROUP BY created_at | |
ORDER BY created_at |
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
#my | |
select code,id from reactions group by code; | |
#pg | |
select distinct on (code) code,id from reactions; |
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
// test for fixed positioning | |
Modernizr.addTest("positionfixed", function() | |
{ | |
// OK since iOS 5 | |
//if (navigator.userAgent.match(/AppleWebKit\/(.*)Mobile\//)) return false; | |
if (navigator.userAgent.match(/Android(.*)Mobile/)) return false; | |
var test = document.createElement("div"), | |
control = test.cloneNode(false), | |
fake = false, |
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
NSMutableAttributedString *attrStr = [NSMutableAttributedString attributedStringWithString:@"Text to kern"]; | |
[attrStr addAttribute:(NSString *)kCTKernAttributeName | |
value:[NSNumber numberWithInt:-1] | |
range:NSMakeRange(0, [attrStr length])]; | |
[self.introLabel setAttributedText:attrStr]; |
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
NSMutableAttributedString *attrStr = [NSMutableAttributedString attributedStringWithString:content]; | |
range = NSMakeRange(0, [attrStr length]); | |
[attrStr setFont:[UIFont fontWithName:LBFontBryantMedium size:16]]; | |
[attrStr setTextAlignment:CTTextAlignmentFromUITextAlignment(UITextAlignmentLeft) | |
lineBreakMode:CTLineBreakModeFromUILineBreakMode(UILineBreakModeWordWrap)]; | |
[attrStr addAttribute:(NSString *)kCTKernAttributeName | |
value:[NSNumber numberWithFloat:-0.4] | |
range:range]; | |
[attrStr addAttribute:(NSString *)kCTParagraphStyleAttributeName |