Skip to content

Instantly share code, notes, and snippets.

View cbertelegni's full-sized avatar

Cristian Bertelegni cbertelegni

View GitHub Profile
<?php
$url = @(htmlspecialchars($_GET["url"]));
$key = @(htmlspecialchars($_GET["key"]));
$key2 = @(htmlspecialchars($_GET["key2"]));
$max_age = @mysql_real_escape_string(htmlspecialchars($_GET["max-age"]));
$json = @mysql_real_escape_string(htmlspecialchars($_GET["json"]));
$output = @mysql_real_escape_string(htmlspecialchars($_GET["output"]));
$opts = array('http' =>
@cbertelegni
cbertelegni / permalink.js
Created July 5, 2015 00:42
Simple method javascript for set and get permalinks
var gulp = require('gulp'),
connect = require('gulp-connect');
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
build = require('gulp-build'),
minifyCSS = require('gulp-minify-css'),
sourcemaps = require('gulp-sourcemaps'),
clean = require('gulp-clean'),
htmlreplace = require('gulp-html-replace'),
@cbertelegni
cbertelegni / mp3_to_chart.py
Last active August 29, 2015 14:16
Make amplitude audio chart from mp3 folder.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob, os, gc
from time import sleep
from pylab import *
import numpy as np
# we wanna make plots like in Matlab!
@cbertelegni
cbertelegni / README.md
Last active August 29, 2015 14:16
HTML / CSS - Conceptos básicos (Taller)

Taller HTML / CSS -Conceptos principales-

HTML

Etiquetas importantes

En su mayoría los tags de html deben tener apertura y cierre, <nombre_tag>Contenido</nombre_tag>. Ejemplo: <p>Esta es un tag de párrafo.</p>

  • h1, h2, h3: Títulos
@cbertelegni
cbertelegni / README.md
Created February 18, 2015 20:10
Error with Nekogiri gem on Ubuntu 14.04

Error in bundle update on Ubuntu 14.04: error occurred while installing nokogiri

Solution

gem install nokogiri -- \
    --use-system-libraries \
    --with-xml2-config=/usr/bin/xml2-config \
    --with-xslt-config=/usr/bin/xslt-config
@cbertelegni
cbertelegni / csv_to_json.py
Last active August 29, 2015 14:14
Export with Python a json from csv file.
#! python
import csv, json
path = "app/data"
csv_path = "%s/nisman.csv" % path
data_out_path = "%s/data.json" % path
reader = csv.DictReader(open(csv_path))
@cbertelegni
cbertelegni / search_twitter.py
Created January 26, 2015 18:59
Search all results and save into file.
#!/usr/bin/python
from twitter import * # need install twitter.py: `pip install twitter`
import json
import time
from urlparse import urlparse, parse_qs
"""SETTINGS"""
from twitter_keys import OAUTH_TOKEN, OAUTH_SECRET, TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET
@cbertelegni
cbertelegni / search_twitter.php
Created January 26, 2015 18:50
Search de twitter con php. Usando la libreria : TwitterAPIExchange
<?php
ini_set('display_errors', 1);
require_once('lib/TwitterAPIExchange.php');
/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
require "conf.php";
define("LAST_METADATA_SEARCH_FILE", "app/data/last_metadata_search.txt");
define("TUITS_FILE", "app/data/tuits_nisman.txt");
@cbertelegni
cbertelegni / models.py
Created November 20, 2014 20:38
ejemplo de como queda el inspectdb de django
class Bien(models.Model):
# id = models.IntegerField(primary_key=True) # AutoField?
# tipo_bien_id = models.IntegerField(blank=True, null=True)
# nombre_bien_id = models.IntegerField(blank=True, null=True)
tipo_bien_s = models.CharField(max_length=255, blank=True)
nombre_bien_s = models.CharField(max_length=255, blank=True)
descripcion = models.CharField(max_length=255, blank=True)
direccion = models.CharField(max_length=255, blank=True)
barrio = models.CharField(max_length=255, blank=True)
localidad = models.CharField(max_length=255, blank=True)