Skip to content

Instantly share code, notes, and snippets.

@agustinhaller
agustinhaller / defferred example
Created February 14, 2013 19:40
defferred example
var scraper = (function(){
var scrape_retailer = function(retailer, product_keyword){
var urlGet = retailer.endpoint.replace("{{KEYWORD}}",product_keyword),
retailer_products = [],
$dfd = $.Deferred();
appAPI.request.get(urlGet,
function(response, responseHeaders)
{
@agustinhaller
agustinhaller / index.html
Created March 19, 2013 13:44
youtube video resize
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Fluid Width YouTube Videos</title>
<meta name="viewport" content="width=device-width">
<style>
<div class="row contact-container">
<div class="span6">
<div class="title">
<p>
Tu opinión no es importante; es imprescindible.
</p>
<p>
¡Escribinos a: contacto@hubinternacional.org y ayudamos a ser mucho mejores!
</p>
</div>
@agustinhaller
agustinhaller / facebook conversion stuff
Created May 15, 2013 17:45
facebook conversion stuff
/******************************************************************************************************/
/************************************** FACEBOOK CONVERSION STUFF **************************************/
/******************************************************************************************************/
var asuntos_fb_pixel_id = 6008163913304,
relaciones_fb_pixel_id = 6008163930504,
graduados_fb_pixel_id = 6008164203504,
fb_value = '0.00',
function fb_conv(fb_pixel_id)
{
@agustinhaller
agustinhaller / soviax_init.sql
Last active December 20, 2015 17:49
Soviax sql structure
CREATE SCHEMA soviax_site;
CREATE TABLE soviax_site.packages (
id serial PRIMARY KEY, -- Es lo mismo que el autoincrement
name text NOT NULL UNIQUE,
title text NOT NULL,
departure_dates text NOT NULL,
price_desc text NOT NULL,
start_date date NOT NULL,
end_date date NOT NULL,
@agustinhaller
agustinhaller / makeId.js
Created August 8, 2013 03:06
makeId function
function makeid(length)
{
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for(var i=0; i < length; i++)
{
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
@agustinhaller
agustinhaller / collection_helper.js
Created August 8, 2013 03:20
JS Collection Helper
var collection_helper = (function () {
var collection = [],
$collection = $(collection),
inCollection = function (item) {
//debugger;
var index = -1,
iterator = 0,
total_iterator = $collection.length;
for (iterator; iterator < total_iterator; iterator++) {
@agustinhaller
agustinhaller / git-rm.sh
Created August 8, 2013 18:31
remove all deleted files - git
git diff --diff-filter=D --name-only -z | xargs -0 git rm
@agustinhaller
agustinhaller / TC Hackathon LOG
Last active December 26, 2015 14:49
TC Hackathon LOG
- Create bitbucket repo
- Researching what to do with the face detection and face recognition stuff, investigating opencv or any API.
- Share repo to team mates
- Create local environment
- Initial push
- Clone git repo in team mates computers
- Create heroku app
- Decided we are going to use Sky Biometry API for the face detection and face recognition part
- Decided we are going to use php for the backend and lot of javascript for the frontend
@agustinhaller
agustinhaller / setinterval-alternative.js
Created November 15, 2013 21:09
Setinterval alternative
// Reference: http://www.thecodeship.com/web-development/alternative-to-javascript-evil-setinterval/
function interval(func, wait, times){
var interv = function(w, t){
return function(){
if(typeof t === "undefined" || t-- > 0){
setTimeout(interv, w);
try{
func.call(null);
}