Skip to content

Instantly share code, notes, and snippets.

View JeffreyWay's full-sized avatar

Jeffrey Way JeffreyWay

View GitHub Profile
Comment by David Mark:
"We should get this out into the open. There seems to be a commonly held belief that jQuery users are ignorant, and, more often than not, designers. Where did this come from, and is it true?"
Hi there... and yes *most* jQuery users are designers with no need to learn programming (let alone cross-browser scripting). That's fine for them as they only need to make mock-ups, not production Websites.
"Roots"
Hi there, again. :)
@JeffreyWay
JeffreyWay / thing.php
Created November 29, 2011 22:11
Turn querystring into associative array
$querystring = 'first=jeff&last=way';
$final = array();
foreach( explode('&', $querystring) as $p ) {
list($key, $value) = explode('=', $p);
$final[$key] = $value;
}
// Test it
echo "<pre>";
@JeffreyWay
JeffreyWay / progressPolyfills.js
Created December 14, 2011 04:17
Progress Polyfill
// Get files here: https://github.com/LeaVerou/HTML5-Progress-polyfill
// Also get custom build of Modernizr - with Modernizr.load, and the Community Progress add-on
Modernizr.load({
test: Modernizr.progressbar,
nope: [
'js/progressPoly.js',
'css/progressPoly.css'
]
});
@JeffreyWay
JeffreyWay / grid.css
Created December 15, 2011 16:34
Simple CSS Grid in Stylus
full_width = 80
columns = 12
gutter = 1
.container
width unit(full_width, '%')
margin auto
overflow hidden
div[class^="grid_"]
@JeffreyWay
JeffreyWay / gist:1486709
Created December 16, 2011 16:25
Autosave CSS from Chrome
Autosave from Chrome Notes:
Watch: http://addyosmani.com/blog/autosave-changes-chrome-dev-tools/
Installation Instructions: https://github.com/NV/chrome-devtools-autosave
Afraid of Node? Here's a one-click install: https://sites.google.com/site/nodejsmacosx/
To monitor changes, you have to run `node chrome-devtools-autosave-server/index.js` in the Terminal. This is hard to remember,
so create an alias. Run
@JeffreyWay
JeffreyWay / meThinks.js
Created December 18, 2011 15:34
Simple JS Testing
function meThinks(assertion) {
return {
shouldEqual: function(bool) {
if ( assertion !== bool ) {
throw new Error('FAIL');
}
}
};
}
@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@JeffreyWay
JeffreyWay / gist:1544440
Created December 31, 2011 16:06
Local XHR in Chrome
# Add to ~/.bash_profile
function chrome() {
open $@ --args --allow-file-access-from-files
}
# Usage - chrome index.html
# now you don't have to worry about those pesky local XHR issues in Chrome.
@JeffreyWay
JeffreyWay / jquery-method.js
Created January 3, 2012 20:01
Envato Marketplace API - Get Popular Items and Authors
$.getJSON('http://173.255.193.46/api/edge/popular:themeforest.json?callback=?', function(files) {
var imgs;
files = files.popular;
console.log(files); // see what's available to play with
imgs = $.map(files.items_last_week, function(file, i) {
return '<a href="' + file.url + '"><img src=' + file.thumbnail + '></a>';
});
@JeffreyWay
JeffreyWay / bash
Created January 6, 2012 02:17
Run Generated CSS Through Prefixr.com on Save with LiveReload
css="`cat style.css`" && curl -sSd css="$css" http://prefixr.com/api/index.php > style.css