Skip to content

Instantly share code, notes, and snippets.

View erickmendonca's full-sized avatar
:shipit:
Shippin'

Erick Mendonça erickmendonca

:shipit:
Shippin'
View GitHub Profile
@erickmendonca
erickmendonca / router_factory.py
Created February 1, 2017 17:06
Django REST Framework RouterFactory - build simple APIs automatically
# Use with caution!
from rest_framework import routers, serializers, viewsets
class RouterFactory(object):
def __init__(
self,
router=routers.DefaultRouter(),
models=[],
base_serializer_class=serializers.ModelSerializer,
@erickmendonca
erickmendonca / email.html
Last active August 17, 2016 12:23
Django - Sending a email from template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>
{% block title %}
{% endblock %}
</title>
</head>
<body>
@erickmendonca
erickmendonca / hooks post-receive
Created November 15, 2015 21:05
Simple git deploy
#!/bin/sh
GIT_WORK_TREE=/home/to/app git checkout -f
@erickmendonca
erickmendonca / caravana-devfest-ne-2015.md
Last active September 10, 2021 03:32
Caravana DevFest Nordeste 2015

Transporte

  • Ônibus
    • R$ 1600,00
    • até 15 pessoas
  • Avião
    • R$ 364,00, ida 16/10, volta 18/10
    • R$ 290,00, ida 16/10, volta 19/10
  • 6h30 de viagem, 1 parada em Salvador
@erickmendonca
erickmendonca / $PROFILE
Last active August 29, 2015 14:06
Git PowerShell Profile
#http://stackoverflow.com/a/23201953
#Create a PowerShell Profile: New-Item -Type file -Path $PROFILE -Force
#Edit it: notepad $PROFILE
#s = git status
function Get-GitStatus { & git status $args }
New-Alias -Name s -Value Get-GitStatus
#c = git commit -m
function Get-GitCommit { & git commit -am $args }
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@erickmendonca
erickmendonca / push_my_ip.py
Created May 8, 2014 02:52
Push IP through Pushbullet
#!/usr/bin/python
import netifaces as ni
import os
ips = []
for interface in ni.interfaces():
if interface[0:3] == "eth" or interface[0:3] == "wla":
try: