Watch a table for changes and push a notification with a payload describing the change.
In the Postgres shell:
-- Create the functions
| import pandas as pd | |
| import matplotlib | |
| matplotlib.use('Agg') | |
| import prettyplotlib as ppl | |
| import brewer2mpl | |
| from matplotlib.colors import Normalize | |
| from ggplot import * | |
| from datetime import datetime, timedelta, time | |
| from hdfs import InsecureClient | |
| from email.MIMEMultipart import MIMEMultipart |
| #!/bin/bash | |
| # -*- coding: UTF8 -*- | |
| ## | |
| # Command-line / Shell / Bash - snippets : Cron-related snippets | |
| # Tested on Debian 6 ("Squeeze") | |
| # | |
| # Sources : | |
| # https://drupal.org/node/23714 | |
| # http://www.linuxquestions.org/questions/linux-general-1/crontab-every-10-minutes-117651/ |
| #!/bin/sh | |
| # GENERAL COMMANDS | |
| alias l='ls -AHhlp' | |
| alias c='clear' | |
| alias cx='chmod +x' | |
| alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" | |
| alias reload='source ~/.bash_profile' | |
| alias release='xattr -d com.apple.quarantine' | |
| alias flushdns='sudo discoveryutil udnsflushcaches' |
Watch a table for changes and push a notification with a payload describing the change.
In the Postgres shell:
-- Create the functions
| import select | |
| import datetime | |
| import psycopg2 | |
| import psycopg2.extensions | |
| from sqlalchemy import create_engine, text | |
| engine = create_engine("postgresql+psycopg2://vagrant@/postgres") |
| import Vision | |
| //1 | |
| let sourceImage = UIImage(named: "jony.jpg") | |
| var resultImage = sourceImage | |
| //2 | |
| let detectFaceRequest = VNDetectFaceLandmarksRequest { (request, error) in | |
| //4 | |
| if let results = request.results as? [VNFaceObservation] { | |
| //5 | |
| for faceObservation in results { |
| import hashlib as hasher | |
| import datetime as date | |
| # Define what a GrahamCoin block is | |
| class Block: | |
| def __init__(self, index, timestamp, data, previous_hash): | |
| self.index = index | |
| self.timestamp = timestamp | |
| self.data = data | |
| self.previous_hash = previous_hash |
| ################################################################################################ | |
| # name: convert_daily_to_monthly.py | |
| # desc: takes inout as daily prices and convert into monthly data | |
| # date: 2018-06-15 | |
| # Author: conquistadorjd | |
| ################################################################################################ | |
| import pandas as pd | |
| import numpy as np | |
| print('*** Program Started ***') |
| Key/Command | Description |
|---|---|
| Tab | Auto-complete files and folder names |
| Ctrl + A | Go to the beginning of the line you are currently typing on |
| Ctrl + E | Go to the end of the line you are currently typing on |
| Ctrl + U | Clear the line before the cursor |
| Ctrl + K | Clear the line after the cursor |
| Ctrl + W | Delete the word before the cursor |
| Ctrl + T | Swap the last two characters before the cursor |
| import os | |
| import boto3 | |
| from flask import Flask, render_template, request, url_for, redirect | |
| app = Flask(__name__) | |
| AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID'] | |
| AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY'] | |
| S3_BUCKET = os.environ['S3_BUCKET'] |