Skip to content

Instantly share code, notes, and snippets.

View p3drosola's full-sized avatar
🔥
this_is_fine.jpg

Pedro Solá p3drosola

🔥
this_is_fine.jpg
  • Mexico City, Mexico
View GitHub Profile
@p3drosola
p3drosola / gist:4232626
Created December 7, 2012 11:20
sublimelinter settings
{
"jshint_options" : {
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@p3drosola
p3drosola / preview_tasks.js
Created September 19, 2012 11:59
Task preview
$(function () {
var regex = /\/#!\/projects\/[^\/]+\/tasks\/(\d+)\/?/;
function showModal (model) {
console.log('previewing task#' + model.id, model);
var view, dialog;
view = new Teambox.Views.Thread({model: model});
dialog = (new Teambox.Views.Dialog({
@p3drosola
p3drosola / infinite.js
Created April 12, 2012 16:12
Piccsy infinite scroll
// requires Infinite Scroll plugin by Paul Irish
// https://github.com/paulirish/infinite-scroll/blob/master/jquery.infinitescroll.min.js
$(function() {
if ($('#leftColumn').length > 0){
var $ci = $('<div id="container-inner"></div>').prependTo('#container');
$('#header, #fbFloat, #wrapper, #leftColumn, #rightColumn').detach().appendTo($ci);
$ci.infinitescroll({
navSelector: "#pager",
@p3drosola
p3drosola / validateXML.js
Created April 5, 2012 09:33
Javascript XML validation
function validateXML(txt)
{
// code for IE
if (window.ActiveXObject)
{
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(document.all(txt).value);
if(xmlDoc.parseError.errorCode!=0)