Skip to content

Instantly share code, notes, and snippets.

View pote's full-sized avatar

pote pote

View GitHub Profile
View 2015-2020.json
"nombre": "Agazzi, Ernesto",
"link": "",
"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 | jq '.[].name'"

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

Prerequisito: tener instalado jq

pote / example.go
Last active February 4, 2018 04:01
View example.go
// 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 ( on keybase.
  • I have a public key ASChCUPzS9zSHI-E8Bf-8_0LjfpSmeI6yA13dWIQxTQG4Ao

To claim this, I am signing this object:

pote / Makefile
Last active October 13, 2015 11:56
Golang binary embeddable views
View Makefile
# This Makefile is a slimmed down version from an actual project, to make deployment
# easier all the html files in `views/` are copied into Go files as constants and
# placed under `src/views/`, assuming `GOPATH="$PWD/.deps:$PWD" (1) this means that in
# your code you can get the contents of `views/index.html` as `views.INDEX`.
# There is also how I handle dependencies with gpm, which is unrelated, but I though
# I'd leave it for the hell of it.
# (1) You don't need to have that exact GOPATH, but "$PWD" does need to be included in
pote / 0_reuse_code.js
Last active August 29, 2015 14:09
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View deploy-web.yml
- hosts: web
sudo: yes
accelerate: true
app_dir: "/var/www/the_application_name_goes_here"
RACK_ENV: "production"
SSO_SALT: "esta no es la salt de verdad"
REDIS_URL: "redis://rest_of_url"
pote / active_record_hack.rb
Created February 5, 2014 20:17
Single Table Inheritance
View active_record_hack.rb
# Use in subclasses like:
# delegate_details :win_ratio, :tanning_time, to: :wrestling_details
def self.delegate_details(*attributes)
options = attributes.extract_options!
association_name = options.fetch(:to) {
raise "You must specify the name of the details association"
define_method association_name do
super() || send("build_#{association_name}")
pote / Gemfile
Created February 5, 2014 20:14
ruby versioning
View Gemfile
gem 'nokogiri', :git => 'git://', :tag => 'v1.6.0'
pote /
Last active August 29, 2015 13:56
Adventure in variable scoping
Hyrule ~/code/tmp
▸ go run scoping.go
./scoping.go:14: variable is shadowed during return