Skip to content

Instantly share code, notes, and snippets.

View jakebellacera's full-sized avatar

Jake Bellacera jakebellacera

View GitHub Profile
@mixin box-shadow($shadow-1: default, $shadow-2: false, $shadow-3: false, $shadow-4: false, $shadow-5: false, $shadow-6: false, $shadow-7: false, $shadow-8: false, $shadow-9: false, $shadow-10: false) {
// This has to be on a single line due to a bug in the scss parser: https://github.com/nex3/sass/issues/issue/26
$legacy: type-of($shadow-1) == color and type-of(if($shadow-2, $shadow-2, 0)) == number and type-of(if($shadow-3, $shadow-3, 0)) == number and type-of(if($shadow-4, $shadow-4, 0)) == number and type-of(if($shadow-5, $shadow-5, 0)) == number and ($shadow-6 == inset or type-of($shadow-6) == bool) and ($shadow-2 or $shadow-3 or $shadow-4 or $shadow-5 or $shadow-6);
@if $legacy {
@warn "Passing separate arguments for a single shadow to box-shadow is deprecated. " + "Pass the values as a single space-separated list, or use the single-box-shadow mixin. " + "See http://beta.compass-style.org/help/tutorials/upgrading/antares/ for more info.";
@include single-box-shadow(if($shadow-1, $shadow-1,
w = container width
s = spacing
n = amount of columns
=====
CSS
=====
.columns {
width: w; /* Width is purely optional. Static, non-floating block elements default at 100% */
ul.nav
li.parent
a
ul.child
li
a
li
a
li
a
def facebook_like(url)
if !url
url = 'http://spyder.com'
if !Rails.env.development?
"<li class=\"fblike\"><iframe src=\"http://www.facebook.com/plugins/like.php?app_id=243807848982732&amp;href=#{URI.escape(url)}&amp;send=false&amp;layout=button_count&amp;width=84&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:84px; height:21px;\" allowTransparency=\"true\"></iframe></li>"
end
end
@jakebellacera
jakebellacera / content-formatting.css
Created August 17, 2011 00:16
CMS Content Formatting
/**
* Content Formatting
* ==================
* Sensible formatting for formatted content.
* gist: http://gist.github.com/1150500
*/
/* Setting a default font */
.content { font: 13px/1.5em sans-serif; }
@jakebellacera
jakebellacera / slideshow.js
Created August 30, 2011 17:58
Slideshows for g(c)
/* Replace the below element with the Slideshow */
var $slideshow = $('#banner').html('');
/* Pull in the JSON feed, place into divs */
$(window).load(function() {
$.ajax({
url : '/api/json/features/HOME_SLIDESHOW',
dataType : 'json',
success : function(data) {
@jakebellacera
jakebellacera / .osx
Created October 2, 2011 04:24
MY .osx
###
# Save this file, make it executable and then run it.
###
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable subpixel font rendering on non-Apple LCDs
defaults write NSGlobalDomain AppleFontSmoothing -int 2
@jakebellacera
jakebellacera / gist:1527062
Created December 28, 2011 08:10
validation.js
// http://docs.jquery.com/Plugins/Validation/Methods/email
email: function(value, element) {
// contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-
@jakebellacera
jakebellacera / parameterize.js
Created January 2, 2012 10:48
Parameterizes a string
function parameterize(value) {
// A simple function that parameterizes a string.
// Example: "This is a title" == "this-is-a-title"
if (typeof value === 'string' || value) {
var output = value.replace(/[^a-zA-Z0-9\s]/g,"");
output = output.toLowerCase();
return output.replace(/\s/g,'-');
} else {
return false;
@jakebellacera
jakebellacera / rvm_ruby
Created January 17, 2012 23:00
Build in Sublime Text 2 with your RVM ruby. mv to ~/bin && chmod +x (with custom gemset features)
#!/usr/bin/env ruby
file = File.expand_path(ARGV[0] || (STDERR.puts('you must specify a ruby file'); exit(-1)))
# Run in RVM
exec("[[ -s \"$HOME/.rvm/scripts/rvm\" ]] && source \"$HOME/.rvm/scripts/rvm\" && rvm use YOUR_RUBY@YOUR_GEMSET && ruby #{file}")
# ends here