Skip to content

Instantly share code, notes, and snippets.

@jlong
jlong / dabblet.css
Created February 15, 2012 17:37
Untitled
.button {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-o-border-radius: 4px;
-ms-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px;
@jlong
jlong / jquery.autogrow.js
Last active February 27, 2020 08:39
Autogrow Textareas in jQuery
/*
* jquery.autogrow.js
*
* A plugin written for UserVoice that makes it easy to create textareas
* that automatically resize to fit their contents.
*
* Based on Scott Moonen's original code for Prototype.js:
*
* <http://scottmoonen.com/2008/07/08/unobtrusive-javascript-expandable-textareas/>
*
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jlong
jlong / create_user.rb
Created May 24, 2012 12:41
Creating a user with the UserVoice API
#!/usr/bin/env ruby
require 'rubygems'
require "oauth"
require 'json'
def symbolize_hash(hash)
symbolized_hash = {}
puts hash.inspect
@jlong
jlong / tickets.rb
Created May 24, 2012 12:55
Creating and listing tickets with the UserVoice API
# 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_forum.rb
Created May 24, 2012 12:57
Creating a forum with the UserVoice API
#! /usr/bin/env ruby
require 'rubygems'
require "oauth"
require 'json'
# Trusted Client
KEY = 'CLIENT KEY'
SECRET = 'CLIENT SECRET'
SITE = 'http://your_subdomain.uservoice.com'
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 / grids.sass
Created August 14, 2012 21:40
Grids
// 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)}
@jlong
jlong / flags.scss
Created September 4, 2012 21:14
Flags?
// Contrived example:
@mixin text-shadow($value, !important) {
text-shadow: $value $important;
}
a {
@include text-shadow(none) !important;
}
//
// 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);