Skip to content

Instantly share code, notes, and snippets.

View sescobb27's full-sized avatar
🇨🇴
sisas parce

Simon Escobar Benitez sescobb27

🇨🇴
sisas parce
View GitHub Profile
def salaries_by_lang(salaries, lang)
salaries.find_all{|x| x[:in_what_technologies_are_you_proficient?] =~ /#{lang}/}
end
# company_type can be for example: multinational, outside, exclusively
def salaries_by_company_type(salaries, company_type)
salaries.find_all{|x| x[:"referring_to_the_company_or_project_that_you_work_for_most_of_the_time:"] =~ /#{company_type}/}
end
FROM ubuntu-debootstrap:14.04
RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty main' >/etc/apt/sources.list
RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty-security main' >>/etc/apt/sources.list
RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty-updates main' >>/etc/apt/sources.list
RUN echo 'deb http://archive.ubuntu.com/ubuntu trusty universe' >>/etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y --force-yes \
@Mistobaan
Mistobaan / context_example.go
Created May 4, 2015 19:29
context Example
// Default HTTP handler
type Handler func(ctx *Context, w http.ResponseWriter, r *http.Request) error
// ServeHTTP implements http.Handler for our custom type Handler
func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx = NewContext(r)
defer ctx.Cancel()
err := h(ctx, w, r)
Just some stuff you might like to read / watch on the plane if you are interested.
OP-ED:
http://www.evanmiller.org/four-days-of-go.html
Video:
https://youtu.be/elu0VpLzJL8 -- Go for pythonista's -- 51m
https://youtu.be/woCg2zaIVzQ -- Concurrency + Composition -- 14m
https://youtu.be/B-r3Wf_I2Lk -- General stuff -- 18m
https://www.youtube.com/playlist?list=PLMW8Xq7bXrG58Qk-9QSy2HRh2WVeIrs7e -- Others
require 'objspace'
class A
# When we include a module, it makes an invisible "included class" (T_ICLASS),
# and places it in the inheritance hierarchy, as the superclass.
# Hence A the inclusion, A no longer has a direct reference to Object,
# it now has a direct reference to the included class
ObjectSpace.reachable_objects_from(self) # => [#<InternalObject:0x007f8cd29343b8 T_CLASS>, "A", Object]
m = Module.new
include m
@taotetek
taotetek / encode.go
Created May 24, 2015 16:59
ReadWriter support in goczmq
package main
import (
"encoding/gob"
"fmt"
"github.com/zeromq/goczmq"
)
// person is an example type we will encode, send, and decode
@michiwend
michiwend / limited_wait_group.go
Created May 31, 2015 17:13
Limited wait group in Go (Golang)
type LimitedWaitGroup struct {
limit int
count int
countChan chan int
}
func NewLimitedWaitGroup(limit int) *LimitedWaitGroup {
wg := LimitedWaitGroup{limit: limit}
wg.countChan = make(chan int)
return &wg
@dcadenas
dcadenas / missing_heroku_config_vars
Created June 6, 2015 01:37
Shows ENV vars in the Rails app that can't be found in the heroku config
#!/bin/bash
echo "These ENV variables only exist in the rails app but not in the heroku config"
echo
envs_in_rails() {
git grep "ENV\[" | sed "s/.*ENV\[['\"]\(.*\)['\"]\].*/\1/" | sort | uniq
}
envs_in_heroku() {
@yujikiriki
yujikiriki / scalabooks.md
Last active October 13, 2015 04:03
Bibliografía recomendada para aprender Scala, por niveles.