Skip to content

Instantly share code, notes, and snippets.

View fluential's full-sized avatar
💭
¯\_(ツ)_/¯

Mike fluential

💭
¯\_(ツ)_/¯
  • Earth
View GitHub Profile
@fluential
fluential / flask_dynamic_form.py
Created December 17, 2018 11:08 — forked from ivanleoncz/flask_dynamic_form.py
Obtaining all data (keys/values) from POST request (form) in Python Flask.
#!/usr/bin/python3
""" Obtaining all form fields (dynamically) from a POST request.
$ curl http://127.0.0.1:8000/post -d "name=Nemo&country=Norway"
$ curl http://127.0.0.1:8000/data -d "company=Axos Inc.&business=IT Outsourcing"
"""
from flask import abort, Flask, jsonify, request
__author__ = "@ivanleoncz"
@fluential
fluential / haproxy-json-log-format.txt
Created November 30, 2016 15:08
haproxy-json-log-format
log-format: '{"timestamp":%Ts,"frontend_name":"%f","remote_addr":"%ci","bytes_read":%B,"upstream_addr":"%si","backend_name":"%b","retries":%rc,"bytes_uploaded":%U,"upstream_connect_time":"%Tc","session_duration":"%Tt","termination_state":"%ts","srv_queue":%sq,"backend_queue":"%bq","frontend_concurrent_conns":%fc,"backend_concurrent_conns":%bc}'
@fluential
fluential / geocoder.py
Last active July 30, 2019 16:05 — forked from scrapehero/geocoder.py
Python script to parse unstructured addresses
from requests import get
from pprint import pprint
from json import dump
from csv import QUOTE_ALL, DictWriter
API_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
def address_resolver(json):
final = {}
if json['results']:
data = json['results'][0]
for item in data['address_components']:
@fluential
fluential / aiohttp_vs_sanic.md
Created March 3, 2020 19:28 — forked from samuelcolvin/aiohttp_vs_sanic.md
comparing aiohttp and sanic performance

Requirements

python 3.6, postgres, pip install aiohttp uvloop ujson asyncpg sanic

aiohttp & uvloop

➤ wrk -d 10 -c 100 -t 12 --timeout 8 http://localhost:8000  # aiohttp
Running 10s test @ http://localhost:8000
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@fluential
fluential / gist:61a5544886746c6dbfbcf44c712da9ec
Created August 24, 2020 15:17
The McAfee central America Travel Guide
The McAfee central America Travel Guide
Posted by: John McAfee , November 24, 2012 @ http://www.whoismcafee.com/the-travel-guide/
As all of my close friends know, I have not always been a teetotalling, drug fighting citizen. Prior to 1983 I was a synthesis of corporate manager and drug dealer. The drug dealer eventually won out, and for a period of time that was my only occupation. Well ….. taking the drugs that I sold also became a principal occupation. This is not a secret, I tell anyone who asks, even the press. Not many in the press reported much about it, until Josh Davis’ eBook came out. I am not ashamed of my past. Our collective pasts make us who we are. In 1983 I joined Alcoholics Anonymous and gave up alcohol and drugs entirely. My exceptions are coffee, which some classify as a drug, and, occassionally, cigarettes. Not proud of the cigarettes, I know thay are bad.
During my drug dealing days I became adept at those talents required of a successful drug dealer: clandestine travel throu
@fluential
fluential / radio_system.liq
Created March 2, 2021 19:55 — forked from GeekBrony/radio_system.liq
Liquidsoap Radio System
###########################################################################################
# Liquidsoap Radio System - built by GeekBrony, based from Liquidsoap. #
###########################################################################################
# Primary Features:
# - AutoDJ that crossfades between songs and has a 1/10 chance of landing on a Station ID/Jingle/Ad.
# - AutoDJ also selects tracks from "High Priority", "Low Priority" and "New Songs" playlists randomly.
# - Live Shows (that automatically dump to a directory)
# - Mic to speak over the stream.
# - Requests via Telnet/Web Interface, which have a 80-90% chance of queuing up when a song ends.
@fluential
fluential / .gitlab-ci.yml
Created March 8, 2021 10:03 — forked from florentchauveau/.gitlab-ci.yml
GitLab CI yaml file for building docker images
# This is a GitLab CI configuration to build the project as a docker image
# The file is generic enough to be dropped in a project containing a working Dockerfile
# Author: Florent CHAUVEAU <florent.chauveau@gmail.com>
# Mentioned here: https://blog.callr.tech/building-docker-images-with-gitlab-ci-best-practices/
# do not use "latest" here, if you want this to work in the future
image: docker:18
stages:
- build
@fluential
fluential / .screenrc-main-example
Created March 12, 2021 12:29 — forked from ChrisWills/.screenrc-main-example
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
/**
* This method is responsible for creating the Jenkins job.
* @param jobName jobName
* @param timerConfig cron expression to schedule the job
* @return
*/
def createJenkinsJob(def jobName, def timerConfig) {
echo "Creating the job ${jobName}"
// Here I'm using a shared library in the pipeline, so I have loaded my shared library here