Skip to content

Instantly share code, notes, and snippets.

View vieron's full-sized avatar

Javier Sánchez - Marín vieron

View GitHub Profile
@vieron
vieron / update_gh-pages.sh
Created April 15, 2012 18:13 — forked from lloyd/update_gh-pages.sh
A lil script to create a gh-pages branch from a subset of the repository. EXPENSIVE
$ git branch -D gh-pages
$ git branch gh-pages
$ git filter-branch --subdirectory-filter test/ gh-pages
$ git push -f origin gh-pages:gh-pages
@vieron
vieron / install.md
Created April 30, 2012 23:13 — forked from seamusjr/install.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, nvm

Setup new Mac with OSX Lion from scratch.

These commands are good as of 2012-03-18.

Install Xcode 4

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

Note: Make sure you install the XCode Command Line Tools after XCode is done installing. To do this go to Xcodes -> Preferences -> Downloads -> Command Line Tools -> Install. If you don't you might not be able to install brew packages (i.e. brew install wget will fail).*

@vieron
vieron / gist:2787035
Created May 25, 2012 09:50 — forked from n1k0/gist:1501173
PhantomJS: Capturing single dom elements as png files
var page = new WebPage(),
address, output, size;
//capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs
capture = function(targetFile, clipRect) {
var previousClipRect;
var clipRect = {top: 0, left:0, width: 40, height: 40};
if (clipRect) {
if (!isType(clipRect, "object")) {
throw new Error("clipRect must be an Object instance.");
@vieron
vieron / gridster.html
Created July 17, 2012 14:01
gridster.js setup - I
<script type="text/javascript" src="libs/jquery.js"></script>
<script type="text/javascript" src="jquery.gridster.js"></script>
@vieron
vieron / gridster.html
Created July 17, 2012 14:33
gridster.js setup - I
<div class="gridster">
<ul>
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1"></li>
<li data-row="2" data-col="1" data-sizex="1" data-sizey="1"></li>
<li data-row="3" data-col="1" data-sizex="1" data-sizey="1"></li>
<li data-row="1" data-col="2" data-sizex="2" data-sizey="1"></li>
<li data-row="2" data-col="2" data-sizex="2" data-sizey="2"></li>
<li data-row="1" data-col="4" data-sizex="1" data-sizey="1"></li>
@vieron
vieron / gridder.js
Created July 17, 2012 14:35
grister.js setup - III
$(function(){ //DOM Ready
$(".gridster ul").gridster({
widget_margins: [10, 10],
widget_base_dimensions: [140, 140]
});
});
@vieron
vieron / gridster.js
Created July 17, 2012 14:42
gridster.js access API
$(function(){ //DOM Ready
var gridster = $(".gridster ul").gridster().data('gridster');
});
@vieron
vieron / gridster.js
Created July 17, 2012 14:51
Add a new element to the grid
gridster.add_widget('<li class="new">The HTML of the widget...</li>', 2, 1);
@vieron
vieron / gridster.js
Created July 17, 2012 14:58
Remove widget from the grid
gridster.remove_widget( $('.gridster li').eq(3) );
@vieron
vieron / gridster.js
Created July 17, 2012 15:01
Serialize the mapped array of positions.
gridster.serialize();