Skip to content

Instantly share code, notes, and snippets.

View wnstn's full-sized avatar

Winston Hearn wnstn

View GitHub Profile
@wnstn
wnstn / subnav.js
Created August 8, 2012 21:01
subnav compiled
(function() {
$(function() {
return $('.subnav a').on('click', function(event) {
var changeContent, currentSection, page;
event.preventDefault();
currentSection = '#' + $(this).closest('section').attr('id');
changeContent = '#' + $(currentSection + ' .pjax-content').attr('id');
$(changeContent + ' .animate-out').animate({
opacity: 0.0,
@wnstn
wnstn / subnav.coffee
Created August 8, 2012 21:00
subnav js
$ ->
$('.subnav a').on 'click', (event) ->
event.preventDefault()
currentSection = '#' + $(this).closest('section').attr('id')
changeContent = '#' + $(currentSection + ' .pjax-content').attr('id')
$(changeContent + ' .animate-out').animate({
opacity: 0.0,
'margin-left' : '-960px',
}, 500)
$(changeContent).spin()
@wnstn
wnstn / test.css
Created August 1, 2012 19:09
SCSS Loops
#foo {
-webkit-animation: foo 2s 3s normal;
-moz-animation: foo 2s 3s normal;
-ms-animation: foo 2s 3s normal;
-o-animation: foo 2s 3s normal;
animation: foo 2s 3s normal; }
@wnstn
wnstn / animations.less
Created August 1, 2012 17:43
Bad Less
.keyframes(@name, @class) {
@-webkit-keyframes @name { @class }
@-moz-keyframes @name { @class }
@-ms-keyframes @name { @class }
@-o-keyframes @name { @class }
}
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = csgit:upperroom.git
[branch "master"]
/*
* WIDGET-CALLOUT
* Simplest possible widget, intended for sidebar highlights
* Contents:
* - Title
* - Header
* - Byline
* - Read-More link
*/
class AddAcademyFacultyPage < ActiveRecord::Migration
def self.up
site = Site.find_by_subdomain('academy')
aboutpage = site.pages.find_by_slug('about')
page = site.pages.find_by_slug('about-faculty')
aboutpage.children << page
1.upto(4) do |i|
site = Site.find_by_subdomain('academy')
page = site.pages.find_by_slug('about-faculty')
4.times do |i|
id = i + 1
tab = page.widgets.find_by_name("tab_#{id}")
10.times do |j|
faculty_member = tab.children.find_by_name("faculty_#{j}")
faculty_member.children << CheckboxWidget.create!(:name => "featured_#{j}")
end
require 'spec_helper'
describe Answer do
describe "in general" do
before(:all) do
site = Factory(:site)
page = Factory(:page)
@answer = Factory(:answer, :page_id => page.id, :site_id => site.id)
subject {@answer}
end
class Admin::AnswersController < Admin::AdminController
helper :answers
def index
@answers = @site.answers
end
def show
@answer = Answer.find(params[:id])