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
SELECT | |
client.id, | |
client.name, | |
fop.start_effective_date, | |
fop.end_effective_date, | |
EXTRACT(month FROM fop.end_effective_date)::integer AS month, | |
SUM(CASE subscription.product_id WHEN 64 THEN subscription.unit_value ELSE subscription.unit_value * subscription.qty END) AS total | |
FROM | |
master | |
LEFT JOIN |
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 socket | |
from time import sleep | |
import os | |
import unittest | |
import tempfile | |
from subprocess import Popen, PIPE | |
from flask import url_for | |
import flaskr |
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 | |
import cgi | |
import urllib | |
import urllib2 | |
import sys | |
import cgitb | |
cgitb.enable() | |
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 | |
import cgi | |
import urllib | |
import urllib2 | |
import sys | |
import cgitb | |
cgitb.enable() | |
AMQ_URL = 'http://amq:8161/api/message/healthcheck.xpto?type=queue&clientId=xpto' |
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
JENKINS_HOME="/usr/share/java/jenkins" | |
LOG="/var/log/slave-jenkins.log" | |
JENKINS_URL="http://jenkins.url:8080" | |
SLAVE_COMPUTER="slave_computer_name" | |
REMOTE_JAR="$JENKINS_URL/jnlpJars/slave.jar" | |
JNLP_URL="$JENKINS_URL/computer/$SLAVE_COMPUTER/slave-agent.jnlp" | |
SECRET="YOUR SECRET ON JENKINS" |
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 json | |
with open('json file path') as f: | |
json_data = json.load(f) | |
json_data[0]['key'] = 'new value' | |
print(json.dumps(json_data)) |
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 datetime import datetime | |
from flask import current_app, stream_with_context, Response | |
from flask_blueprint_acquisition import current_blueprint | |
from sqlalchemy.sql import compiler | |
from .blueprints import base_blueprint | |
from .models import Acquisition, Package, Product, User | |
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
PID_FILE = '/tmp/flask_test_uwsgi.pid' | |
LOG_FILE = '/tmp/flask_test_uwsgi.log' | |
up: | |
uwsgi --ini uwsgi.ini --wsgi-file app.py --pidfile $(PID_FILE) --logto $(LOG_FILE) & | |
down: | |
uwsgi --stop $(PID_FILE) |
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 json | |
import csv | |
from optparse import OptionParser | |
def json_to_csv(json_filename, csv_filename): | |
with open(json_filename, 'r') as json_file: | |
json_decoded = json.load(json_file) | |
with open(csv_filename, 'w') as csv_file: |
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 urllib | |
import requests | |
# OAuth2 Server URL | |
URL = 'https://oauth2.server' | |
# URL to redirect after login | |
REDIRECT_URI = 'https://redirect.url' | |
# Client ID and Secret Key | |
CLIENT_ID = '' |
OlderNewer