Skip to content

Instantly share code, notes, and snippets.

Avatar

Eli Dupuis elidupuis

View GitHub Profile
@elidupuis
elidupuis / gist:4596282
Last active Dec 11, 2015 — forked from pulkitsinghal/gist:1481376
Import repo from Unfuddle to BitBucket
View gist:4596282
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 Mar 8, 2013
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 …
View index.html
<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>
@elidupuis
elidupuis / setup.sh
Last active Dec 25, 2015
Steps to get up and running with Grunt.js, from scratch.
View setup.sh
# install nvm
# see https://github.com/creationix/nvm
# be sure to restart your terminal after this step
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
# install Node
# use nvm. if you cannot, download binary from Node website http://nodejs.org/download/
nvm help
nvm ls-remote
# install a recent version
@elidupuis
elidupuis / README.md
Created Nov 27, 2013
Simple filtering example using Stapes.js and Rivets.js
View README.md

Dependencies managed with Bower:

npm install -g bower
bower install

...Then open up index.html in a browser.

@elidupuis
elidupuis / README.md
Last active Jan 2, 2016
The Circles of Life
View README.md

Dev setup

python -m SimpleHTTPServer 8080
sass --watch style.scss:style.css
@elidupuis
elidupuis / component.json
Last active Aug 29, 2015
Combining Cordova deviceready and domready in a Component(1) app
View component.json
{
"locals": [
"foobar"
],
"dependencies": {
"jb55/domready": "*"
},
"scripts": [
"index.js"
]
@elidupuis
elidupuis / README.md
Last active Aug 29, 2015
Cordova cross platform configuration gotchas
View README.md

Cordova handles A LOT of cross platform issues for us, but not all of them. We can simplify these by using a YML or JSON config file to keep track of the differences so our code can stay slim and maintainable.

This concept is based on this article which I found from this SO answer.

@elidupuis
elidupuis / README.md
Last active Jun 22, 2018
Path from mouse or touch input
View README.md

Simple Drawing Example

Click and drag your mouse (or finger on touch device) to draw a line. A new path is created for each touch or click.

Paths are stored in a nested array; you can inspect the variable in console: session (assuming the example is in it's own window).

@elidupuis
elidupuis / web-intent.js
Created May 13, 2014
Simple Cordova WebIntent test function
View web-intent.js
// https://github.com/InQBarna/WebIntent
function testIntent () {
console.log('testIntent...');
if (window.device) {
console.log('DEVICE mode; testing web intent: startActivity');
var address = 'edmonton alberta';
CDV.WEBINTENT.startActivity({
action: CDV.WEBINTENT.ACTION_VIEW,
@elidupuis
elidupuis / reload-hasmany.js
Created Dec 5, 2014
Dynamically reload all hasMany relationships for a model.
View reload-hasmany.js
/**
* You can use this in a model or afterModel hook...
* see http://emberjs.com/api/data/classes/DS.Model.html#method_eachRelationship
*
* Not really tested or sure if this is a good idea... just had the thought and wanted to record it.
*/
model.eachRelationship(function(name, relationship) {
if (relationship.kind === 'hasMany' && relationship.options.async) {
this.get(name).reload();
}