Skip to content

Instantly share code, notes, and snippets.

View philipefarias's full-sized avatar

Philipe Farias philipefarias

  • Belo Horizonte, MG, Brazil
View GitHub Profile
https://github.com/sorah/mamiya
Faster deploy tool using tarballs and serf
https://github.com/eagletmt/switch_point
Switching database connection between readonly one and writable one
https://github.com/cookpad/rrrspec
Distributed RSpec
https://github.com/amatsuda/database_rewinder
@philipefarias
philipefarias / 0_reuse_code.js
Created December 16, 2015 16:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@philipefarias
philipefarias / data_munging.md
Last active June 22, 2017 03:38
Code Kata: Data Munging. Here’s an exercise in three parts to do with real world data. Try hard not to read ahead—do each part in turn.

Code Kata: Data Munging

Part One: Weather Data

In weather.dat you'll find daily weather data for Morristown, NJ for June 2002. Download this text file, then write a program to output the day number (column one) with the smallest temperature spread (the maximum temperature is the second column, the minimum the third column).

Part Two: Soccer League Table

The file football.dat contains the results from the English Premier League for 2001/2. The columns labeled 'F' and 'A' contain the total number of goals scored for and against each team in that season (so Arsenal scored 79 goals against opponents, and had 36 goals scored against them). Write a program to print the name of the team with the smallest difference in 'for' and 'against' goals.

Part Three: DRY Fusion

Take the two programs written previously and factor out as much common code as possible, leaving you with two smaller programs and some kind of shared f

@philipefarias
philipefarias / redis_migrate.py
Last active August 5, 2022 20:32 — forked from josegonzalez/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_string):
conn = redis.StrictRedis(conn_string)
return conn