Skip to content

Instantly share code, notes, and snippets.

Ezequiel Alejandro Becerra betzerra

Block or report user

Report or block betzerra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View secret_santa.rb
people = ARGV
possible_receivers = people.dup
result = {}
people.each do |p|
# a person doesn't have to give a gift to himself;
tmp = possible_receivers.dup
tmp.delete(p)
receiver = tmp.sample
@betzerra
betzerra / .zshrc
Last active Dec 29, 2017
Querying Canillitapp with a little of shell scripting
View .zshrc
# optional, I added some of my scripts at the bottom of my ~/.zshrc
# (I'm using oh-my-zsh https://github.com/robbyrussell/oh-my-zsh)
alias canillitapp_latest="~/Scripts/latest_news.sh"
alias canillitapp_popular="~/Scripts/popular_news.sh"
alias canillitapp_search="~/Scripts/search_news.sh"
alias canillitapp_trending="~/Scripts/trending_news.sh"
@betzerra
betzerra / Instructions
Last active May 11, 2017
Noticias de Mayo de Daniel Scioli. Powered by Canillitapp.
View Instructions
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
@betzerra
betzerra / get_reactions.rb
Last active Apr 21, 2017
Any idea how to write this better?
View get_reactions.rb
Reaction.joins(:news).where(user: user).as_json(include: :news).to_json
@betzerra
betzerra / twitter_to_i2c_lcd.rb
Created Aug 27, 2016
Print a twitter stream into an I2C LCD screen
View twitter_to_i2c_lcd.rb
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"
View gist:e1325656a6c54a9bfc751da102dbaf35
@betzerra
betzerra / news.sh
Last active Dec 26, 2015
Muestra las últimas noticias en medios argentinos
View news.sh
#!/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 / README.md
Last active Dec 19, 2015 — forked from oncletom/README.md
Instagram Hashtag Archiver
View README.md

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 / gist:68957450ed5d6e9dd912
Last active Aug 29, 2015
Spring animation using iOS 7
View gist:68957450ed5d6e9dd912
// 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;
};
You can’t perform that action at this time.