Skip to content

Instantly share code, notes, and snippets.

View betzerra's full-sized avatar

Ezequiel Alejandro Becerra betzerra

View GitHub Profile
@betzerra
betzerra / .zshrc
Last active December 29, 2017 02:04
Querying Canillitapp with a little of shell scripting
# 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 / secret_santa.rb
Created December 11, 2018 14:42
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
require 'faraday'
require 'nokogiri'
response = Faraday.new.get 'https://www.santander.com.ar/ConectorPortalStore/Rendimiento'
html = Nokogiri::HTML(response.body)
desired_items = [
'SUPER AHORRO $ CUOTA A',
'SUPER AHORRO PLUS CUOTA A',
'SUPERGESTION MIX VI CUOTA A'
@betzerra
betzerra / app.rb
Last active May 15, 2020 20:35
COVID-19
require 'nokogiri'
require 'faraday'
require 'pry'
conn = Faraday.new
response = conn.get 'https://www.worldometers.info/coronavirus/'
covid_page = Nokogiri::HTML(response.body)
puts '"Country";"Infected";"Deaths";"ID ratio"'
@betzerra
betzerra / dither.sh
Last active December 10, 2022 18:20
Dither images
#!/bin/bash
filename="${1%.*}"
extension="${1##*.}"
convert $1 -colorspace Gray -ordered-dither o2x2 "${filename}_gray_ordered.gif"
convert $1 -ordered-dither o2x2 "${filename}_ordered.gif"
convert $1 -monochrome "${filename}_monochrome.gif"
convert $1 -remap pattern:gray50 "${filename}_remap_gray.gif"
convert $1 -remap netscape: "${filename}_remap_netscape.gif"