Skip to content

Instantly share code, notes, and snippets.

View spalladino's full-sized avatar
🔷

Santiago Palladino spalladino

🔷
View GitHub Profile
@spalladino
spalladino / leaflet-nobounce.js
Created August 22, 2014 21:20
Handler for leaflet.js to manage max bounds without bouncing
// Initialize OSM source, based on map.html example
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
// Create map with max bounds
var map = L.map('map')
.setView([50.5, 30.51], 15)
.addLayer(osm)
.setMaxBounds([[50.52979753992208, 30.527229309082035],[50.497049833624224, 30.458564758300785]]);
@spalladino
spalladino / changelog.py
Created November 7, 2014 15:32
Create changelog for a new Cepheid version based on git log and fogbugz data
#! /usr/bin/python
from fogbugz import FogBugz
from datetime import datetime, timedelta
from itertools import groupby
import subprocess
import re
import sys
@spalladino
spalladino / hub.gs
Last active August 29, 2015 14:10
Google Spreadsheets InSTEDD Hub
/**
* Adds a custom menu to the active spreadsheet, containing a single menu item
* for invoking the readRows() function specified above.
* The onOpen() function, when defined, is automatically invoked whenever the
* spreadsheet is opened.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function onOpen() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
@spalladino
spalladino / backup-poirot.sh
Created April 9, 2015 14:03
Backups all distinguished Poirot entries in a monthly index and deletes the individual per-day indices
#! /bin/bash
# Invoke using YYYY.MM of indices to backup
# exit on uncaught error
set -e
# non zero exit status on a pipeline causes the whole pipeline to fail
set -o pipefail
function backup_index {
@spalladino
spalladino / mbuilder-demo.js
Last active August 29, 2015 14:24
Small mBuilder demo firing external trigger and requesting table data
// Small mBuilder demo firing external trigger and requesting table data
var request = require('request');
var http = require('http');
// Fire external trigger
var symptom = 'headache';
var message = 'Rest well';
var projectId = 278;
@spalladino
spalladino / keybase.md
Created August 31, 2015 15:21
Keybase proof

Keybase proof

I hereby claim:

  • I am spalladino on github.
  • I am spalladino (https://keybase.io/spalladino) on keybase.
  • I have a public key whose fingerprint is 2A1E 62DE 71BC 4FC5 08D1 4A61 DA26 E6C4 5CB6 8D15

To claim this, I am signing this object:

@spalladino
spalladino / main.py
Created May 1, 2011 20:21
Asignacion de gastos en publicidad oficial de un organismo a un proveedor por rubro en base a vistas agregadas
import csv
import networkx as nx
from decimal import *
from itertools import *
FILE_SALIDA = 'output.csv'
FILE_PROVEEDOR = 'ocrtest_segundo_semestre_prov_rubro CORREGIDO.csv'
FILE_ORGANISMO = 'ocrtest_segundo_semestre_organismo_rubro CORREGIDO.csv'
class Data:
@spalladino
spalladino / jquery-form-reset.js
Created June 13, 2011 18:58
Add reset function to jquery wrapped forms
$.fn.extend({
reset: function(){
return this.each(function(){
$(this).is('form') && this.reset();
})
}
});
@spalladino
spalladino / devisetesting.rb
Created August 3, 2011 13:46
Disable password hashing in devise for testing
module Devise
module Models
module DatabaseAuthenticatable
protected
def password_digest(password)
password
end
end
end
@spalladino
spalladino / EventThreadListModel.java
Created October 27, 2011 22:15
EventThreadListModel
public class EventThreadListModel extends DefaultListModel {
private static final long serialVersionUID = -4389671662282607290L;
private void invokeOnEventThread(Runnable r) {
try {
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeAndWait(r);
} else {
r.run();
}