Skip to content

Instantly share code, notes, and snippets.

View wnstn's full-sized avatar

Winston Hearn wnstn

View GitHub Profile
@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 }
}
@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 / 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 / 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 9, 2012 19:22
finding pjax
$ ->
$('.subnav a').on 'click', (event) ->
event.preventDefault()
# Find the section of the page to load the new content
currentSection = '#' + $(this).closest('section').attr('id')
# Find the div that pjax should replace
changeContent = '#' + $(currentSection + ' .pjax-content').attr('id')
#fetch the new content and animate it in
→ rspec spec/
1) School scopes#for_user ValEdAdmin should return the list of schools for the admin
Failure/Error: School.for_user(user).should == [school_1, school_2]
expected: [#<School id: 2358, district_id: 3016, name: "Test School", school_type: "public", created_at: "2012-08-13 18:54:16", updated_at: "2012-08-13 18:54:16", deleted_at: nil>, #<School id: 2359, district_id: 3017, name: "Test School", school_type: "public", created_at: "2012-08-13 18:54:17", updated_at: "2012-08-13 18:54:17", deleted_at: nil>]
got: [#<School id: 2359, district_id: 3017, name: "Test School", school_type: "public", created_at: "2012-08-13 18:54:17", updated_at: "2012-08-13 18:54:17", deleted_at: nil>, #<School id: 2358, district_id: 3016, name: "Test School", school_type: "public", created_at: "2012-08-13 18:54:16", updated_at: "2012-08-13 18:54:16", deleted_at: nil>] (using ==)
Diff:
@@ -1,3 +1,2 @@
-[#<School id: 2358, district_id: 3016, name: "Test School", school_type: "publ
@wnstn
wnstn / app.coffee
Created August 30, 2012 03:51
mochaclub.coffee
$ ->
options =
autoPlay: true
autoPlayDelay: 6000
transitionThreshold: -100
startingFrameID: 1
nextButton: "#sequence .next"
prevButton: "#sequence .prev"
pauseOnHover: true
@wnstn
wnstn / visit_js.js.coffee
Created September 12, 2012 22:38
goal data
if goal
plotData = [
{
data: tracking
lines:
show: true
lineWidth: 1
points:
show: true
radius: 3
@wnstn
wnstn / _visit.html.erb
Created September 12, 2012 22:41
data being passed in
<div class="outcome-section graph-container">
<h3 class="boxed-header">Overall Progress <%= records.last.integer_value %></h3>
<h3 class="boxed-header">Goal <%= ogoal.goal %></h3>
<div style="height:300px;" class="graph" data-scale="<%= ogoal.scale.min %>-<%= ogoal.scale.max %>" data-goal="<%= ogoal.goal %>" data-coordata="<%= records.to_a.map { |r| "#{r.progress_report.due_date.to_time.to_i*1000}|#{(r.integer_value)}" }.join(",") %>">
</div>
</div>
<div class="outcome-section graph-container">
<h3 class="boxed-header">Overall Progress <%= records.last.integer_value %></h3>
patients = Patient.find(:all)
patients.each do |patient|
patient.name