Skip to content

Instantly share code, notes, and snippets.

View rasoliveira's full-sized avatar

Rafael Oliveira rasoliveira

View GitHub Profile
@rasoliveira
rasoliveira / search_customers_for_survey_design.rb
Created November 23, 2018 02:04
A script to dump customers and their surveys info so that we can plan enabling the survey designer
def subdomains
[
#first batch
"insideview",
"surveydesignsandbox",
"di",
"dhhooli",
"hoolitest",
"cultureamp",
"airtasker",
@rasoliveira
rasoliveira / kubernetes.md
Last active February 18, 2018 12:08
Getting kubernetes to run

Starting

minikube start

Set docker environment

eval $(minikube docker-env)

Building image

docker build -t <image-name>:<version> . Don't forget the version tagging or else we hit unsafety registry when deploying with kubectl

(dispatcher/dispatch ['id1 'id2] [:event :arg :arg])
(dispatcher/dispatch :all [:event :arg])
(dispatcher/dispatch :self [:event :arg]) ;;no server
(dispatcher/dispatch :chat/brasil [])
(dispatcher/dispatch [dest-id] [:chat/message {:text "Aê!"}]) =server=> orig-id event-v
(handler :chat/message (fn [db orig-id v] ;; [:chat/message {:text "Aê"}] = v
@rasoliveira
rasoliveira / primes.clj
Last active December 7, 2018 18:34
primes in clojure
(ns primes)
(defn divides? [number divisor]
(zero? (mod number divisor)))
(divides? 4 2) ;; => true
(divides? 8 1) ;; => true
(divides? 3 2) ;; => false
(divides? 2 4) ;; => false
@rasoliveira
rasoliveira / gist:7657329
Created November 26, 2013 12:07
Evolution of e-mail
Evolution of e-mail
===================
1965 - Introduced at MIT
1982 - SMTP created
1990 - beggining of spam
1997 - yahoo mail
2006 - facebook
2007 - gmail
@rasoliveira
rasoliveira / myip.sh
Created April 4, 2012 10:52
Prints you external IP address on the screen
#!/bin/bash
# Filename: myip.sh
# Synopsis: Access whatsmyip.com servers and prints you external IP address
# on the screen
# Author: Rafael Oliveira <ludug3r0@gmail.com>
# License: Fell free to use, copy, modify, distribute, etc
# Note: Do a favor to the whatsmyip.com guys and do not over use
# their network. Try to wait 300 seconds to use this program a second
@rasoliveira
rasoliveira / correios.sh
Created June 29, 2011 17:30
Script simples para anunciar mudanças no rastreio dos Correios
RASTREIO="<CODIGO DE RASTREIO AQUI>"
ENDERECO="http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_TIPO=001&P_COD_UNI=${RASTREIO}"
MUSICA="<MUSICA PARA TOCAR AQUI>"
wget $ENDERECO -O a
while true; do
wget $ENDERECO -O b
diff a b -q
if [ $? -ne 0 ] ; then
mplayer "$MUSICA"