Skip to content

Instantly share code, notes, and snippets.

View pote's full-sized avatar

pote pote

View GitHub Profile
[
{
"nombre": "Agazzi, Ernesto",
"link": "https://parlamento.gub.uy/camarasycomisiones/legisladores/5146",
"id": "5146",
"citaciones": 97,
"asistencias": 97,
"faltas_con_aviso": 0,
"faltas_sin_aviso": 0,
"no_citado_por_licencia": 10,

En tu .bashrc

alias movie="curl https://movieprodwebapi.azurewebsites.net/api/shows/content/weekly/list?showType=cinema | jq '.[].name'"

alias endgame="movie | grep -E 'Avengers|Vengadores' && say 'WHATEVER IT TAKES'"

Prerequisito: tener instalado jq

@pote
pote / example.go
Last active February 4, 2018 04:01
// So, in order to unmarshal json easily with Go it's important to code Go structs that
// follow the structure of the data you will receive. It might be a bit of extra coding
// up front, but I think it has some nice benefits since you can then can work with native
// structs and have type safety enforced.
// Keep in mind that this is an example so my naming might not be the best, but I hope it
// will be helpful to you anyways.
// I created the structs and their relationships based on the sample response from the API
// documentation you sent me, which is copied at the bottom for clarity.

Keybase proof

I hereby claim:

  • I am pote on github.
  • I am pote (https://keybase.io/pote) on keybase.
  • I have a public key ASChCUPzS9zSHI-E8Bf-8_0LjfpSmeI6yA13dWIQxTQG4Ao

To claim this, I am signing this object:

@pote
pote / 1old.txt
Last active December 21, 2015 22:58
New vs old johnny-deps output and execution times.
▸ time curl -s https://raw.github.com/VividCortex/johnny-deps/v0.1.5/bin/johnny_deps | bash
github.com/VividCortex/robustly (download)
github.com/VividCortex/ewma (download)
Setting github.com/VividCortex/robustly to version v1.0
Previous HEAD position was aefdcf1... Update VividCortex link
HEAD is now at ec98a8c... Godeps utility
github.com/VividCortex/ewma (download)
Setting github.com/VividCortex/ewma to version v1.0
Previous HEAD position was a4d14fa... Update README.md
HEAD is now at 2f8aa97... Refactor package name
#!/bin/bash -l
shopt -s nullglob
enqueue() {
for rev; do
echo -n "$rev" > "$(mktemp "$queuedir/$(date +%s).XXXXXX")"
done
}
ActiveRecord::Schema.define(:version => 20130203210553) do
create_table "people", :force => true do |t|
t.string :name
t.string :birthday
t.string :place_of_birth
t.string :blood_type
t.string :type # => Needed for the ORM to know which kind of object its dealing with.
ActiveRecord::Schema.define(:version => 20130203210553) do
create_table "people", :force => true do |t|
t.string :name
t.string :birthday
t.string :place_of_birth
t.string :blood_type
end
create_table :scientists, :force => true do |t|
@pote
pote / app.rb
Last active December 17, 2015 04:28
Proof of concept using Class Table Inheritance
require 'sequel'
DB = Sequel.connect 'sqlite://database.db'
class Person < Sequel::Model
# has age, name, type
end
Person.plugin :class_table_inheritance, key: :type