Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Gonzalo gonzafirewall

🏠
Working from home
Block or report user

Report or block gonzafirewall

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View googleviews.py
from google.oauth2 import id_token
from google.auth.transport import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
@gonzafirewall
gonzafirewall / boto_sns.py
Last active Jun 13, 2016 — forked from gjedeer/boto_sns.py
How to send a push notification directly to device using Python, Boto and SNS
View boto_sns.py
import boto
import boto.exception
import boto.sns
import pprint
import re
def send_push(device_id, body):
region = [r for r in boto.sns.regions() if r.name==u'eu-west-1'][0]
sns = boto.sns.SNSConnection(
View Simple POST LOGGER
from flask import Flask
from flask import request, Response
app = Flask(__name__)
@app.route("/", methods=["POST"])
def index():
print request.form
return Response("ok")
View png2svg.py
# Require imagemagick
# require potrace
# sudo apt-get install imagemagick potrace
import os
import argparse
import glob
parser = argparse.ArgumentParser()
parser.add_argument(
"files", type=str, help="png2svg", nargs="*"
View pex-reqs.py
import sys
if len(sys.argv) > 1 and sys.argv[1] :
fname = sys.argv[1]
else:
fname = "req.txt"
f = open(fname, 'r+')
cmd = 'pex '
View simple-rrd-merge.py
#!/usr/bin/env python
"""Simple script to merge multiple RRD files together.
Accepts any number of RRD file names as arguments. Produces an "rrdtool dump"
style file on stdout. The last RRD file should have a slot for every possible
record in the resulting merged RRD.
Run something like:
$ python simple-merge-rrd.py filea.rrd fileb.rrd filec.rrd | \
You can’t perform that action at this time.