This file contains hidden or 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 sqlalchemy | |
import os | |
def get_mssql_turbodbc_engine(server, database): | |
conn = "mssql+turbodbc://{0}/{1}?trusted_connection=yes;driver=ODBC+Driver+13+for+SQL+Server".format(server, database) | |
return sqlalchemy.create_engine(conn) | |
def get_mssql_pyodbc_engine(server, database): |
This file contains hidden or 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
The MIT License (MIT) | |
Copyright (c) 2018 Gouthaman Balaraman | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains hidden or 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, render_template_string, redirect | |
from flask_sqlalchemy import SQLAlchemy | |
from flask_login import UserMixin, LoginManager, login_user, logout_user | |
from flask_blogging import SQLAStorage, BloggingEngine | |
from flask_admin import Admin | |
from flask_admin.contrib.sqla import ModelView | |
db = SQLAlchemy() | |
app = Flask(__name__) | |
app.config["SECRET_KEY"] = "secret" # for WTF-forms and login |
This file contains hidden or 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 re | |
# Identify URL | |
re.findall('(?:http://|www.)[^"\' ]+', html) |
This file contains hidden or 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
# Linked Luigi Example - Gouthaman Balaraman | |
# http://gouthamanbalaraman.com/blog/building-luigi-task-pipeline.html | |
import luigi | |
class SimpleTask(luigi.Task): | |
""" | |
SimpleTask prints Hello World!. |
This file contains hidden or 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
# Minimal Luigi Example - Gouthaman Balaraman | |
# http://gouthamanbalaraman.com/blog/building-luigi-task-pipeline.html | |
import luigi | |
class SimpleTask(luigi.Task): | |
""" | |
This simple task prints Hello World! | |
""" |
This file contains hidden or 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
The MIT License | |
Further resources on the MIT License | |
Copyright 2014 Gouthaman Balaraman | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
This file contains hidden or 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
__author__ = 'Gouthaman Balaraman' | |
import sys | |
import os | |
import win32event | |
import win32service | |
import win32serviceutil | |
import win32api | |
import win32con | |
import logging |
This file contains hidden or 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
<!-- Serve this file, for example "python -m SimpleHTTPServer"--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script> | |
var symbol='yhoo'; | |
$.getJSON("http://query.yahooapis.com/v1/public/yql", | |
{ | |
q : "select * from yahoo.finance.stocks where symbol='"+symbol+"'", |