Skip to content

Instantly share code, notes, and snippets.

View elidupuis's full-sized avatar

Eli Dupuis elidupuis

View GitHub Profile
@elidupuis
elidupuis / safari_search_input
Created November 18, 2010 21:19
Make Safari render an search input as a regular text input
input[type="search"] { -webkit-appearance: textfield; }
@elidupuis
elidupuis / jquery_plugin_template.js
Created December 17, 2010 01:26
A base structure to use when building new plugins!
(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');
@elidupuis
elidupuis / jquery.equalizeHeights.js
Created February 28, 2011 23:07
Simple plugin to equalize the heights of selected elements
// stolen from http://api.jquery.com/map/
// usage: $('div').equalizeHeights();
$.fn.equalizeHeights = function(){
return this.height( Math.max.apply( this, $(this).map(function(i,e){ return $(e).height() }).get() ) );
}
@elidupuis
elidupuis / purrrify.click.html
Created April 8, 2011 04:31
Usage examples of the jquery.purrrify plugin
<script>
$(function(){
// this will trigger purrrify when $('#myTrigger') is clicked:
$.purrrify({
trigger: { selector: '#myTrigger', event: 'click' }
});
});
</script>
@elidupuis
elidupuis / jquery.matchWidth.js
Created August 10, 2011 21:15
jquery plugin to set the width of an element to the sum of it's children's width
$.fn.matchWidth = function(){
// Prepare
var $this = $(this);
// Action
$this.width(function(){
var w = 0;
$(this).children().each(function(){
w += $(this).outerWidth(true);
});
@elidupuis
elidupuis / README.md
Created December 6, 2012 21:41
D3 + Albers + zoom behavior

Alberta Aboriginal Treaty Lands.

Error: Assertion Failed: You must use Ember.set() to set the `currentState` property (of <app@component:ui/cell-assignment::ember1408>) to `[object Object]`.
at new Error (native)
at Error.EmberError (http://localhost:4200/assets/vendor.js:27314:21)
at Object._emberMetalCore.default.assert (http://localhost:4200/assets/vendor.js:16033:13)
at SETTER_FUNCTION [as currentState] (http://localhost:4200/assets/vendor.js:30817:34)
at _emberMetalMixin.Mixin.create._transitionTo (http://localhost:4200/assets/vendor.js:56379:44)
at Renderer.willDestroyElement (http://localhost:4200/assets/vendor.js:23700:12)
at Renderer.remove (http://localhost:4200/assets/vendor.js:23668:10)
at Object._emberMetalMerge.default.destroyElement (http://localhost:4200/assets/vendor.js:59776:21)
at Object._emberMetalMerge.default.cleanup (http://localhost:4200/assets/vendor.js:59768:25)
@elidupuis
elidupuis / application.controller.js
Created December 7, 2015 23:53
mailTo anchor tag
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@elidupuis
elidupuis / gist:4596282
Last active December 11, 2015 11:48 — forked from pulkitsinghal/gist:1481376
Import repo from Unfuddle to BitBucket
mkdir temp
cd temp
git clone git@yourDomain.unfuddle.com:yourDomain/yourRepoName.git
cd yourRepoName/
git remote rm origin
git remote add origin https://yourUsername@bitbucket.org/yourUsername/yourNewRepoName.git
git remote show origin
git push origin master
cd ../..
rm -rf temp
@elidupuis
elidupuis / index.html
Created March 8, 2013 06:57
A CodePen by Eli Dupuis. Foundation block-grid - Foundation's block grids are awesome but they only work if all the elements are the same height. This SCSS snippet will allow the elements to be different heights. It works by simply clearing every nth element—based on how many columns you have. You can comment out the SCSS to see how the default …
<h1>Using both small and large grids</h1>
<ul class='small-block-grid-2 large-block-grid-4'>
<li><img src='http://placekitten.com/g/200/220' /></li>
<li><img src='http://placekitten.com/g/200/200' /></li>
<li><img src='http://placekitten.com/g/200/280' /></li>
<li><img src='http://placekitten.com/g/200/250' /></li>
<li><img src='http://placekitten.com/g/200/240' /></li>
<li><img src='http://placekitten.com/g/200/270' /></li>
<li><img src='http://placekitten.com/g/200/230' /></li>