Skip to content

Instantly share code, notes, and snippets.

View shaneriley's full-sized avatar

Shane Riley shaneriley

View GitHub Profile
@shaneriley
shaneriley / colors.styl
Last active August 29, 2015 14:00
Color iteration in Stylus? Nope.
// Only one of the strings in the list of colors gets interpolated, thanks
// to Stylus converting the color keywords to hex values.
// Thanks, Stylus!
li
for color in red pink orange yellow green blue purple brown black shit
&.{color}
background: color
// What I had to do instead to make it work. Note that simply wrapping the
@shaneriley
shaneriley / skeleton
Last active August 29, 2015 14:16
HTML Skeleton
<!doctype html>
<html lang="en-US">
<head>
<title></title>
<meta charset="UTF-8" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
</body>
@shaneriley
shaneriley / gist:ab945b15084f47056ad5
Created March 23, 2015 19:54
State select element
<select name="state">
<option>AK</option>
<option>AL</option>
<option>AR</option>
<option>AZ</option>
<option>CA</option>
<option>CO</option>
<option>CT</option>
<option>DC</option>
<option>DE</option>
console.clog = function() {
var format = "font: normal 18px 'Comic Sans MS', Chalkboard; color: purple;";
if (arguments.length > 1) {
console.log("%c" + arguments[0], format, [].slice.call(arguments, 1));
}
else {
console.log("%c" + arguments[0], format);
}
};
module UiHelper
def dummy_image(width, height, background=nil, text=nil)
background = background ? "/#{background}" : ""
text = text ? "/#{text}" : ""
content_tag :img, nil, alt: "", "data-src" => "/placeholder/#{width}x#{height}#{background}#{text}"
end
def lorem_paragraph(quantity = 3)
Faker::Lorem.paragraphs(quantity).join
end
class WireframesController < ActionController::Base
public_pages = [:sign_in, :confirm_registration, :homepage, :register, :business_admin_layout]
survey_pages = [:survey_1, :survey_2, :survey_3]
before_filter :admin_layout, :except => public_pages + survey_pages
before_filter :public_layout, :only => public_pages, :except => :business_admin_layout
before_filter :survey_layout, :only => survey_pages
def admin_layout
render :layout => "nuguava_admin"
end
$("a[data-method='delete']").live("click.delete", function() {
var $e = $(this);
if ($e.attr("data-confirm")) {
if (!confirm($e.attr("data-confirm"))) {
return false;
}
}
var $form = $("<form />");
$("<input />").attr({
type: "hidden",
var isIphone = (function() {
return navigator.userAgent.match(/iPhone|iPod/i) != null;
})();
var isIpad = (function() {
return navigator.userAgent.match(/iPad/i) != null;
})();
A B C D E F G
1 + + +
2 + + +
3 + + + + + + +
4 + + + + + +
5 + + + + + + +
6 + + +
7 + + +
@shaneriley
shaneriley / gist:895001
Created March 30, 2011 18:49
Dummy Image Helper
def dummy_image(dimensions, bg_color="cccccc", fg_color="333333")
"http://dummyimage.com/#{dimensions}/#{bg_color}/#{fg_color}"
end