This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mix.install([:swoosh, :hackney, :mail]) | |
Application.put_env(:myapp, Prueba.Mailer, adapter: Swoosh.Adapters.Gmail, access_token: {:system, "GMAIL_API_ACCESS_TOKEN"}) | |
Application.put_env(:myapp, :email_conf, to_mail: "prueba_loca@gmail.com", from_mail: "prueba_loca@gmail.com") | |
defmodule Prueba.Mailer do | |
use Swoosh.Mailer, otp_app: :myapp | |
end | |
defmodule Prueba.Enviador do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import request, Response | |
app = Flask(__name__) | |
@app.route("/", methods=["POST"]) | |
def index(): | |
print request.form | |
return Response("ok") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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="*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | \ |