Skip to content

Instantly share code, notes, and snippets.

View stoplion's full-sized avatar
🎯
Focusing

George Norris stoplion

🎯
Focusing
  • Ottertune
  • Elsewhere
View GitHub Profile
@stoplion
stoplion / gist:1448859
Created December 8, 2011 22:05
Bash script to convert Haml to Slim
#!/bin/bash
file_dir='/Users/geoneo/Sites/orion/app/views'
for i in `find ${file_dir} -maxdepth 3 -type f -name "*.haml" ! -empty`
do
output_dir=`dirname $i`
new_file=`basename ${i} | sed 's/\(.*\.\)haml/\1slim/'`
@stoplion
stoplion / gist:1565392
Created January 5, 2012 14:05
Animation for vegas sign (flashing light, background animation toggle)
$(document).ready ->
$('.signup_sign').css('top', '-200px').animate({"top": "-13px"}, 1500)
signup_sign = $('.signup_sign')
light = off
window.setInterval ( ->
if light is off
$(signup_sign).css 'background-position', "-141px 0"
light = on
@stoplion
stoplion / toggle message radio buttons
Created January 5, 2012 14:10
Hide message when any checkbox is checked
$(document).ready ->
$("input[type='checkbox']").change ->
toggle_message()
toggle_message()
toggle_message = ->
if $("input[type='checkbox']").is(":checked")
$("#message").fadeIn()
else
@stoplion
stoplion / star.haml
Created January 5, 2012 14:11
CSS keyframe animation practice
.oblong_container
%div{:class => "oblong green"}
%div{:class => "oblong blue"}
%div{:class => "oblong purple"}
%div{:class => "oblong pink"}
@stoplion
stoplion / Some Mixins I used on the job board
Created January 5, 2012 14:23
Custom Mixins for Orion
@import "compass"
@import "sassy-buttons"
$experimental-support-for-svg: true
$total-cols: 15
$col-width: 3.5em
$gutter-width: 1em
$side-gutter-width: $gutter-width
@stoplion
stoplion / gist:2008323
Created March 9, 2012 19:51
create applications
7.times do |a|
FactoryGirl.create_list(:job_application, SecureRandom.random_number(10)+1, created_at: a.days.ago, job_posting_id: 8103)
end
@stoplion
stoplion / gist:2148256
Created March 21, 2012 15:15
Promise interface to call HighCharts
thirty_days_of_apps = $.getJSON application_chart_url
thirty_days_of_apps.done (data) ->
draw_chart(data, 'application_chart', 'Job Applications in last 30 days', 'Applications', 'areaspline')
draw_number_of_apps(data)
thirty_days_of_apps.fail ->
console.log "You failed congrats!"
draw_number_of_apps = (data) ->
@stoplion
stoplion / headers mixin
Created July 12, 2012 15:23
header mixin
=headers($largest-header: 7em)
@for $i from 1 through 6
h#{$i}
font-weight: bold
font-size: $largest-header / $i
@stoplion
stoplion / full-height-website
Created July 12, 2012 21:16
sass mixin for a full height website
=full-height-website($main-container)
body, html
height: 100%
min-height: 100%
##{$main-container}
height: 100%
min-height: 100%
@stoplion
stoplion / gist:3647536
Created September 5, 2012 23:28
Everything you can override in a refinerycms project with refinerycms-blog
When starting a project that includes refinerycms-blog:
$ rake refinery:override view=refinery/pages/*
$ rake refinery:override view=layouts/*
$ rake refinery:override view=refinery/blog/shared/*
$ rake refinery:override view=refinery/blog/posts/*
$ rake refinery:override view=refinery/*
$ rake refinery:override controller=refinery/blog/*
$ rake refinery:override controller=refinery/*