Skip to content

Instantly share code, notes, and snippets.

View eliassoares's full-sized avatar
🐺
I'm tired of reading about the achievements of better men - Samwell Tarly

Elias Soares eliassoares

🐺
I'm tired of reading about the achievements of better men - Samwell Tarly
View GitHub Profile
@eliassoares
eliassoares / json_to_map.go
Created September 17, 2018 00:10 — forked from cuixin/json_to_map.go
json to map[string]interface{} example in golang
package main
import (
"encoding/json"
"fmt"
)
func dumpMap(space string, m map[string]interface{}) {
for k, v := range m {
if mv, ok := v.(map[string]interface{}); ok {
@eliassoares
eliassoares / mysql-docker.sh
Created January 22, 2018 01:02 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@eliassoares
eliassoares / gist:604fc73005584b6dd22b59091e03f33c
Created December 14, 2017 00:09 — forked from gjreda/gist:7433f5f70299610d9b6b
pandas' read_csv parse_dates vs explicit date conversion
# When you're sure of the format, it's much quicker to explicitly convert your dates than use `parse_dates`
# Makes sense; was just surprised by the time difference.
import pandas as pd
from datetime import datetime
to_datetime = lambda d: datetime.strptime(d, '%m/%d/%Y %H:%M')
%time trips = pd.read_csv('data/divvy/Divvy_Trips_2013.csv', parse_dates=['starttime', 'stoptime'])
# CPU times: user 1min 29s, sys: 331 ms, total: 1min 29s
# Wall time: 1min 30s
@eliassoares
eliassoares / README-Template.md
Created September 14, 2017 11:23 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites