Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

John W. Long jlong

🚀
View GitHub Profile
@jlong
jlong / SassMeister-input.scss
Created Jan 14, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
$sections: red, gold, orange, grey;
@each $i in $sections {
.section-#{$i} {
@jlong
jlong / jquery.preparetransition.js
Last active Dec 28, 2016
A new version of $(el).prepareTransition() that uses a timer instead of the poorly implemented TransitionEnd event to ensure that the 'is-transitioning' class is removed.
View jquery.preparetransition.js
/**
* prepareTransition
*
* jQuery Plugin for ensuring transitions with display:none or visibility:hidden
* are in the right state until the end of the transition
*
* By John W. Long (http://wiseheartdesign.com)
* April 18, 2013
*
* Based on the prepareTransition plugin by Jonathan Snook (http://snook.ca). This version
View compass.rb
# Extension in my Rails lib dir
require 'lib/extensions/sass_widget_image_url'
# This configuration file works with both the Compass command line tool and within Rails.
project_type = :rails
# Require any additional compass plugins here.
require 'susy'
View ms-rotate.scss
//
// Sass rotation mixin for IE6+
//
@mixin ms-rotate($degrees) {
@if (not unitless($degrees)) { $degrees: $degrees / 1deg }
$deg2rad: pi() * 2 / 360;
$radians: $degrees * $deg2rad;
$costheta: cos($radians);
$sintheta: sin($radians);
View flags.scss
// Contrived example:
@mixin text-shadow($value, !important) {
text-shadow: $value $important;
}
a {
@include text-shadow(none) !important;
}
View grids.sass
// Grids
=grids($max-columns: 10)
#{enumerate(".grid", 2, $max-columns)}
+clearfix
@for $columns from 2 through $max-columns
.grid-#{$columns}
+grid($columns)
#{enumerate('.span', 1, $max-columns)}
View test-vs-search.diff
diff --git a/source/docs/index.html b/source/docs/index.html
index da07196..e81e6ac 100644
--- a/source/docs/index.html
+++ b/source/docs/index.html
@@ -45,7 +45,7 @@ sidebar: false
$('.articles li').each(function() {
var li = $(this), a = li.find('a');
- if (expression.test(li.text()) || expression.test(a.attr('data-search-meta'))) {
+ if ((li.text().search(expression) > -1) || (('' + a.attr('data-search-meta')).search(expression) > -1)) {
@jlong
jlong / create_forum.rb
Created May 24, 2012
Creating a forum with the UserVoice API
View create_forum.rb
#! /usr/bin/env ruby
require 'rubygems'
require "oauth"
require 'json'
# Trusted Client
KEY = 'CLIENT KEY'
SECRET = 'CLIENT SECRET'
SITE = 'http://your_subdomain.uservoice.com'
@jlong
jlong / tickets.rb
Created May 24, 2012
Creating and listing tickets with the UserVoice API
View tickets.rb
# helper method
def symbolize_hash(hash)
symbolized_hash = {}
# puts hash.inspect
hash.each do |key, value|
symbolized_hash[key.to_sym] = value
end
return symbolized_hash
end
@jlong
jlong / create_user.rb
Created May 24, 2012
Creating a user with the UserVoice API
View create_user.rb
#!/usr/bin/env ruby
require 'rubygems'
require "oauth"
require 'json'
def symbolize_hash(hash)
symbolized_hash = {}
puts hash.inspect