Skip to content

Instantly share code, notes, and snippets.

View betzerra's full-sized avatar

Ezequiel Alejandro Becerra betzerra

View GitHub Profile
import sys, math, random
class Point:
def __init__(self, coords, reference=None):
self.coords = coords
self.n = len(coords)
self.reference = reference
def __repr__(self):
return str(self.coords)
@betzerra
betzerra / gist:d3259ae845105acd76b5
Created May 25, 2014 18:49
CLGeocoder: kCLErrorDomain == 2
// Error reported in http://stackoverflow.com/questions/23819466/error-return-address-clgeocoder
NSString *anAddressString = @"568 Broadway, New York, NY"
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
void (^geocodeBlock)(NSArray *placemarks, NSError *error) = ^(NSArray *placemarks, NSError *error) {
if (error) {
/*
* Printing error gets -> Error Domain=kCLErrorDomain Code=2 "The operation couldn’t be
@betzerra
betzerra / gist:68957450ed5d6e9dd912
Last active August 29, 2015 14:02
Spring animation using iOS 7
// Set startFrame and endFrame for _contentView
CGRect endFrame = _contentView.frame;
CGRect startFrame = endFrame;
startFrame.origin.y = -startFrame.size.height;
_contentView.frame = startFrame;
void (^animationBlock)(void) = ^(void){
_contentView.frame = endFrame;
};
@betzerra
betzerra / README.md
Last active December 19, 2015 04:57 — forked from thom4parisot/README.md
Instagram Hashtag Archiver

Instagram Hashtag Archiver

This script helps you to download locally the latest pictures related to a specific Instagram hashtag. It will fetch them and sort them by username.

No resume feature. No extra metadata. No OAuth pain.

Install

@betzerra
betzerra / news.sh
Last active December 26, 2015 04:25
Muestra las últimas noticias en medios argentinos
#!/bin/bash
casperjs tn_news.js
./rss_news.rb http://www.clarin.com/rss/lo-ultimo/ Clarin
./rss_news.rb http://contenidos.lanacion.com.ar/herramientas/rss-origen=2 LaNacion
@betzerra
betzerra / twitter_to_i2c_lcd.rb
Created August 27, 2016 08:40
Print a twitter stream into an I2C LCD screen
require 'i2c/drivers/ss1602' # https://github.com/nerab/i2c-ss1602
require 'twitter' # https://github.com/sferik/twitter
display = I2C::Drivers::SS1602::Display.new('/dev/i2c-1', 0x27)
client = Twitter::Streaming::Client.new do |config|
config.consumer_key = "XXX"
config.consumer_secret = "XXX"
config.access_token = "XXX"
config.access_token_secret = "XXX"
@betzerra
betzerra / get_reactions.rb
Last active April 21, 2017 05:34
Any idea how to write this better?
Reaction.joins(:news).where(user: user).as_json(include: :news).to_json
@betzerra
betzerra / Instructions
Last active May 11, 2017 14:22
Noticias de Mayo de Daniel Scioli. Powered by Canillitapp.
curl api.canillitapp.com/search/scioli | jq '.[] | {title: .title, source: .source_name, date: .date | strftime("%B %d %Y %I:%M%p %Z"), url: .url}' > scioli.json