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
[ | |
{ | |
"url": "http://money.cnn.com", | |
"rss": "http://rss.cnn.com/rss/money_topstories.rss" | |
}, | |
{ | |
"url": "http://thehill.com", | |
"rss": "http://thehill.com/rss/syndicator/19110" | |
}, | |
{ |
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 paho.mqtt.client as paho | |
import os | |
import socket | |
import ssl | |
from time import sleep | |
from random import uniform | |
import json | |
import logging | |
logging.basicConfig(level=logging.INFO) |
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, current_app | |
from blinker import Namespace | |
app = Flask(__name__) | |
app.secret_key = 'WOO' | |
my_signals = Namespace() | |
def moo_signal(app, message, **extra): |
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
<VirtualHost _default_:443> | |
ServerName yourhost | |
ServerAdmin someperson@yourorg.com | |
SSLEngine on | |
SSLCertificateFile /etc/ssl/private/yourorg.com.crt | |
SSLCertificateKeyFile /etc/ssl/private/yourorg.com.key | |
SSLCertificateChainFile /etc/ssl/private/chain.pem | |
SSLProxyEngine On |
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
# This gist shows how to integrate Flask into a | |
# custom Gunicorn-WSGI application described | |
# here: http://docs.gunicorn.org/en/stable/custom.html | |
from __future__ import unicode_literals | |
import multiprocessing | |
import gunicorn.app.base |
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 os | |
import falcon | |
import jinja2 | |
def load_template(name): | |
path = os.path.join('templates', name) | |
with open(os.path.abspath(path), 'r') as fp: | |
return jinja2.Template(fp.read()) |
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
# Get youtube id | |
#http://youtu.be/5Y6HSHwhVlY | |
#http://www.youtube.com/embed/5Y6HSHwhVlY?rel=0 | |
#http://www.youtube.com/watch?v=ZFqlHhCNBOI | |
regex = re.compile(r'(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(watch\?v=|embed/|v/|.+\?v=)?(?P<id>[A-Za-z0-9\-=_]{11})') | |
match = regex.match(self.youtube_url) |
NewerOlder