Skip to content

Instantly share code, notes, and snippets.

View rylanb's full-sized avatar
🏠
Working from home

Rylan Bowers rylanb

🏠
Working from home
View GitHub Profile
@rylanb
rylanb / Description.text
Created May 22, 2012 01:21
Facebook IFrame Canvas Flash Issue in Internet Explorer
In Internet Explorer there was an issue where the iframe/canvas embed for a Facebook App would cause flashing as the app redirected to itself over and over as it was blocking any sort of cookies set from an external url...
Source of final AHA:
http://duanesbrain.blogspot.com/2007/11/facebook-ie-and-iframes.html
View the Page's Privacy Policy in Internet Explorer and you should see external cookies blocked for your app that is hosted elsewhere.
Solution:
Set the headers properly! (Or check if you aren't loading a file properly like Duane's solution).
@rylanb
rylanb / Test Data.txt
Created April 29, 2012 22:26
Triangle Method
def test_equilateral_triangles_have_equal_sides
assert_equal :equilateral, triangle(2, 2, 2)
assert_equal :equilateral, triangle(10, 10, 10)
end
def test_isosceles_triangles_have_exactly_two_sides_equal
assert_equal :isosceles, triangle(3, 4, 4)
assert_equal :isosceles, triangle(4, 3, 4)
assert_equal :isosceles, triangle(4, 4, 3)
assert_equal :isosceles, triangle(10, 10, 2)
@rylanb
rylanb / pto.rb
Created April 25, 2012 20:39
Calculating PTO with PTO Class
class Pto
attr_accessor :hire_date, :hire_date_vacation_adjustment, :vacation_this_year, :ytd, :eoy_accrual
def initialize(hire_date, hire_date_vacation_adjustment, vacation_this_year)
self.hire_date = hire_date
self.hire_date_vacation_adjustment = hire_date_vacation_adjustment
self.vacation_this_year = vacation_this_year
calculate_pto
end
@rylanb
rylanb / index.jade
Created April 14, 2012 22:27
Jade for RDIO heavyRotation
- if (albums.length)
- albums.forEach(function(album){
.band-info
a(target="_blank", href="#{album.shortUrl}", class="album-link")
span#album-image
img(src="#{album.icon}", alt="#{album.name}")
span#album-name
a(target="_blank", href="#{album.shortUrl}")
#{album.name}
span#band-name #{album.artist}
@rylanb
rylanb / index.jade
Created April 14, 2012 22:27
Jade for RDIO heavyRotation
- if (albums.length)
- albums.forEach(function(album){
.band-info
a(target="_blank", href="#{album.shortUrl}", class="album-link")
span#album-image
img(src="#{album.icon}", alt="#{album.name}")
span#album-name
a(target="_blank", href="#{album.shortUrl}")
#{album.name}
span#band-name #{album.artist}
@rylanb
rylanb / link.html
Created April 2, 2012 20:25
Code samples for Making Tooltips with CSS3
.current {
display: block !important;
z-index: 980 !important;
}
@rylanb
rylanb / ql_listens.js
Created June 28, 2011 17:02
QL Listens JS
/* This is a work in progress. Refactors/Clean Up to come */
$(function(){
/* Get the user(s) from RDIO for avatars */
$.ajax({
url: "http://qlrdio.herokuapp.com/user/collin?callback=?",
dataType: "jsonp",
success: function(data){
var keyVal = data.key,
iconPic = data.icon;
@rylanb
rylanb / placeholder_example.html
Created April 20, 2011 15:30
Placeholder Plugin Example
<!-- Check for Placeholder support natively in the browser with
Modernizr - modernizr.com or your own check -->
<script type="text/javascript">
if (!Modernizr.input.placeholder){
$('input, textarea').placehold_me();
}
</script>
<!-- example input -->
<input type="text" placeholder="Address" />
location / {
auth_basic "Restricted";
auth_basic_user_file /data/nginx/servers/<app_name>/<app_name>.users;
passenger_enabled on;
}