Integrate https://github.com/fukata/golang-stats-api-handler with https://github.com/errplane/errplane-go/blob/master/api.go#L343 Runtime Statistics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/gob" | |
"fmt" | |
"github.com/zeromq/goczmq" | |
) | |
// person is an example type we will encode, send, and decode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() { |
OlderNewer