Skip to content

Instantly share code, notes, and snippets.

View samueljseay's full-sized avatar
😘

Sam Seay samueljseay

😘
View GitHub Profile
@samueljseay
samueljseay / error
Created November 21, 2012 03:53
tutorial error
1.9.3p327 :013 > pets = %w(rex nibbles fred)
=> ["rex", "nibbles", "fred"]
1.9.3p327 :014 > puts pets.map do |pet|
1.9.3p327 :015 > pet.upcase
1.9.3p327 :016?> end
#<Enumerator:0x007f9b4d02a4f0>
=> nil
1.9.3p327 :017 > puts pets.map(&:upcase)
REX
NIBBLES
@samueljseay
samueljseay / gist:7145313
Created October 24, 2013 21:26
Make your jQuery code play nice with Rails TurboLinks.
$(document).on("page:load",function(){
//do ALL THE THINGS :D
//see http://stackoverflow.com/questions/17386740/rails-4-turbolinks-and-jquery-dynamic-links-not-playing-nice
});
-# HTML5 doctype
!!! 5
!!! strict
!!! XML
%html
-#ie conditionals
/[if IE]
%a{ href: "http://www.mozilla.com/en-US/firefox/" }
@samueljseay
samueljseay / gist:7779276
Last active December 15, 2023 20:22 — forked from jimbojsb/gist:1630790
Color highlight and copy code for presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@samueljseay
samueljseay / gist:13c2e69508563b2f0458
Last active April 7, 2016 19:13
Get real dimensions YUI
function getRealDimensions(node) {
var clone,
result;
if ( ! node ) {
return false;
}
clone = node.cloneNode(true).show().setStyle('visibility','hidden').appendTo('body');
@samueljseay
samueljseay / css
Created July 9, 2014 00:03
Progress Animations with YUI transitions
.progress-indicator {
position: absolute;
height: 40px;
overflow: hidden;
}
.progress-bubble {
background-color: #efefef;
width: 20px;
height: 20px;
// Don't do this
var RecentProblemsComponent = Y.Base.create('prb-recent-problems-component', Y.View, [Y.OHP.Component], {
initializer: function() {
this.goGetData().then(this.renderAThing);
},
renderAThing: function() {
//render part of my UI
this.nowFetchSomeOtherDataPls().then(this.renderOtherThings);
},
// You could do this
var RecentProblemsComponent = Y.Base.create('prb-recent-problems-component', Y.View, [Y.OHP.Component], {
initializer: function() {
this.goGetData().then(this.render);
},
render: function() {
if(this.hasSomeData) {
this.hideProgressIndicator();
this.showData;
@samueljseay
samueljseay / SassMeister-input-HTML.html
Created March 12, 2015 01:05
Generated by SassMeister.com.
<div class='color'></div>
<div class='color-20'></div>
<div class='color-40'></div>
@samueljseay
samueljseay / SassMeister-input-HTML.html
Last active August 29, 2015 14:16
Generated by SassMeister.com.
<div class='color'></div>
<div class='color-dark'></div>
<div class='color-darker'></div>