Skip to content

Instantly share code, notes, and snippets.

Eli Dupuis elidupuis

Block or report user

Report or block elidupuis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brianarn
brianarn / underscore_conditionals.js
Created May 4, 2010
Conditionals with underscore.js
View underscore_conditionals.js
// A means of using underscore.js to do templates with conditionals
// Inside of underscore's template, it returns a function that uses
// 'with' on a variable named obj, and you can touch into that using
// inline JS and <% %> wrappers
// A template with conditional display of last names:
var good = _.template("Hello: <%= name %> <% if (obj.lastname) { %> <%= lastname %> <% } %>");
// A template that tries to do that, but fails:
var bad = _.template("Hello: <%= name %> <% if (lastname) { %> <%= lastname %> <% } %>");
View LINK tags to document with callback
@cowboy
cowboy / HEY-YOU.md
Last active Nov 15, 2019
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
View jquery-patching-tips.sh
# Tips for jQuery Bug Patching
# There are some assumptions made here, one being that you're
# set up with some form of "localhost" http server and that it's running.
# - http://www.mamp.info/en/mamp/
# - sudo apt-get install apache2
# Get it running:
# On Mac:
@chrisyour
chrisyour / Folder Preferences
Created Dec 4, 2010
Show hidden files and hidden folders (except .git) in your TextMate project drawer
View Folder Preferences
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@elidupuis
elidupuis / jquery_plugin_template.js
Created Dec 17, 2010
A base structure to use when building new plugins!
View jquery_plugin_template.js
(function($) {
var methods = {
init: function( options ) {
// iterate and reformat each matched element
return this.each(function() {
var $this = $(this),
opts = $.extend({}, $.fn.PLUGIN_NAME.defaults, options),
data = $this.data('PLUGIN_NAME');
@desandro
desandro / jquery.imagesloaded.js
Created Jan 26, 2011 — forked from paulirish/README.md
$.fn.imagesLoaded jQuery plugin
View jquery.imagesloaded.js
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// Modified with a two-pass approach to changing image
// src. First, the proxy imagedata is set, which leads
// to the first callback being triggered, which resets
// imagedata to the original src, which fires the final,
// user defined callback.
View gist:1041037
$('#selling nav a').click(function(){
var what = $(this).attr('href');
if($(this).hasClass('active') != true){
$(this).addClass('active').parent().siblings().children().removeClass('active');
$('.s-section:visible').animate({
left: '-700px'
}, 500, function() {
$(this).css({'left':'0'}).hide();
});
$(what).css({'left':'700px'}).show().animate({
@nateps
nateps / gist:1172490
Created Aug 26, 2011
Hide the address bar in a fullscreen iPhone or Android web app
View gist:1172490
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name=apple-mobile-web-app-capable content=yes>
<meta name=apple-mobile-web-app-status-bar-style content=black>
<title>Test fullscreen</title>
<style>
html, body {
margin: 0;
padding: 0;
@pjkix
pjkix / css-stats-ack.sh
Created Oct 5, 2011
shell script to generate some css file statistics
View css-stats-ack.sh
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
You can’t perform that action at this time.