Skip to content

Instantly share code, notes, and snippets.

View acarrillo's full-sized avatar

Alejandro (Alex) Carrillo acarrillo

View GitHub Profile
@acarrillo
acarrillo / datefiltr.py
Created July 31, 2012 21:48
A simple filter for converting UNIX epoch timestamps to a more readable format -- works great with Vim!
#!/usr/bin/env python
'''A filter that takes a UNIX epoch timestamp as input, and outputs the date in a more human-friendly format
Put this file somewhere in your PATH and 'chmod +x' it.
In your ~/.vimrc:
vnoremap <silent> <F6> :!datefiltr.py<CR>
@acarrillo
acarrillo / datefiltr.rb
Created August 2, 2012 22:08
A filter for converting timestamps to a more readable date format
#!/usr/bin/env ruby
#
# Authors: Kevin Wang and Alex Carrillo
# Description: Replaces UNIX timestamps with more human-friendy strings
#
# Make this file executable with `chmod +x datefiltr.rb` and put it in your path.
#
# Example usage:
# $ datefiltr.rb < file-with-timestamps.txt > file-with-readable-dates.txt
#
@acarrillo
acarrillo / gist:5772508
Created June 13, 2013 09:44
On Google Spreadsheet form submission, push new entry to a MailChimp subscription list with an `onformsubmit` trigger. Uses the MailChimp API and Google Apps Script.
var API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
var mc_base_url = 'http://us7.api.mailchimp.com/1.3/?method=listSubscribe';
var mc_list_id = 'xxxxxxxxxx';
var mc_double_optin = false;
/**
* Uses the MailChimp API to add a subscriber to a list.
*/
function sendToMailChimp_(fn, ln, em, yr){
@acarrillo
acarrillo / gist:8687e9be0eef138ab09c
Created January 13, 2015 04:58
Code sample for an image rectification algorithm in C++
// MatrixImagingLibrary.cpp [fragment] Alejandro Carrillo (July 2013)
// At the Neuro-Electronic Research Foundation in Belgium, I wrote image
// rectification software for their custom multiphoton microscope.
// The microscope functions by emitting photons and measuring the fluorescence
// of neurons in mice that have genetically encoded calcium indicators.
// In order to sweep the laser across the microscope subject at a maximally high
// frequency, the laser mirror is driven via harmonic resonance.
// The consequence, however, is that the laser sweep is sinusoidal. The following
// functions concern rectifying the sine-warped image that is generated from the