Skip to content

Instantly share code, notes, and snippets.

View mrprompt's full-sized avatar
🏠
Working from home

Thiago Paes mrprompt

🏠
Working from home
View GitHub Profile
@mrprompt
mrprompt / spreadsheet.py
Created April 17, 2018 17:59
Sample code to work with Google Spreadsheet and Python
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pprint
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('python-15f4d92f03f2.json', scope)
client = gspread.authorize(creds)
sheet = client.open('Horta').sheet1
#!/usr/bin/env python
import hashlib
import hmac
import time
import requests
import datetime
# Q. Do you have A Websocket API?
# A. Yes, and we strongly recommend you to use it. Please, check our JavaScript websocket implementation for our WebSocket API here:
# https://github.com/blinktrade/frontend/blob/master/jsdev/bitex/api/bitex.js
@mrprompt
mrprompt / Config file for sSMTP sendmail
Last active October 19, 2017 14:53 — forked from apisznasdin/Config file for sSMTP sendmail
Config file for sSMTP sendmail using Mandrill
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=user@domain.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.mandrillapp.com:587
@mrprompt
mrprompt / s3_makeprivate.rb
Created August 15, 2017 21:02
s3_makeprivate.rb
require 'aws-sdk'
Aws.config.update({
region: 'FOOOOO',
credentials: Aws::Credentials.new(
'FOOOOOOO',
'FOOOOOOOOO'
)
})
bucket_name = 'barbarbarbar'
@mrprompt
mrprompt / schema_clone.py
Created August 4, 2017 16:03 — forked from rabbitt/schema_clone.py
PostgreSQL schema cloner (including data).
import psycopg2 as pg
from io import BytesIO
from collections import defaultdict
from contextlib import contextmanager
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED
READ_COMMIT = ISOLATION_LEVEL_READ_COMMITTED
AUTO_COMMIT = ISOLATION_LEVEL_AUTOCOMMIT
@mrprompt
mrprompt / config.txt
Created December 10, 2016 17:39
Raspberry Pi - melhor performance para VNC em 1366 x 768
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
@mrprompt
mrprompt / turtle.py
Created August 15, 2016 06:29
turtle.py
import turtle
t = turtle.Turtle()
for c in ['red', 'yellow', 'green', 'blue']:
t.color(c)
t.forward(75)
t.left(90)
print "loop ", c
@mrprompt
mrprompt / phpci.yml
Created October 18, 2015 01:26
PHPCI Config
build_settings:
clone_depth: 1
verbose: false
ignore:
- "migrations"
- "public"
- "resources"
- "tmp"
- "tests"
- "vendor"
@mrprompt
mrprompt / ExportSQLite.grt.lua
Created October 31, 2013 15:49
MySQL WorkBench Plugin to export database to SQLite
-- ExportSQLite: SQLite export plugin for MySQL Workbench
-- Copyright (C) 2009 Thomas Henlich
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
@mrprompt
mrprompt / .vimrc
Last active December 15, 2016 22:20
Meu .vimrc
""" Configurações iniciais
set nocompatible " Must come first because it changes other options.
filetype off " Necessary on some Linux distros for pathogen to properly load bundles
" Habilitando o Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()