% python -i colorful_logging_formatter.py
>>> import logging
>>> logger = logging.getLogger('foo')
>>> logger.setLevel(logging.DEBUG)
>>> import sys
>>> handler = logging.StreamHandler(sys.stderr)
>>> handler.setFormatter(ColorLogFormatter())
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
""" | |
Fade IN/OUT some text.. | |
""" | |
import sys | |
import time | |
import pygame | |
## Show some text fade in/out |
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
#!/bin/bash | |
CONTAINER_NAME=my-postgres-database | |
VOLUME_NAME="${CONTAINER_NAME}-data" | |
POSTGRES_PASSWORD=mysecretpassword | |
POSTGRES_IMAGE=postgres:14 | |
case "$1" in | |
start) |
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 collections import namedtuple | |
import re | |
import itertools | |
from datetime import datetime | |
import lxml.etree | |
import requests | |
WIDTH = 40 | |
DATA_URL = 'http://www.hamqsl.com/solarxml.php' |
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 | |
## Generate sine table | |
import math | |
def rescale(X,A,B,C,D,force_float=False): | |
retval = ((float(X - A) / (B - A)) * (D - C)) + C | |
if not force_float and all(map(lambda x: type(x) == int, [X,A,B,C,D])): | |
return int(round(retval)) |
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
{ | |
"title": "Apache logs", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"query": "*", | |
"alias": "", | |
"color": "#7EB26D", | |
"id": 0, |
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
// Some stuff from https://github.com/knicklabs/lorem-ipsum.js | |
const WORDS = [ | |
'ad', 'adipisicing', 'aliqua', 'aliquip', 'amet', 'anim', 'aute', | |
'cillum', 'commodo', 'consectetur', 'consequat', 'culpa', | |
'cupidatat', 'deserunt', 'do', 'dolor', 'dolore', 'duis', 'ea', | |
'eiusmod', 'elit', 'enim', 'esse', 'est', 'et', 'eu', 'ex', | |
'excepteur', 'exercitation', 'fugiat', 'id', 'in', 'incididunt', | |
'ipsum', 'irure', 'labore', 'laboris', 'laborum', 'Lorem', | |
'magna', 'minim', 'mollit', 'nisi', 'non', 'nostrud', 'nulla', |
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
# ------------------------------------------------------------ | |
# Create Hyper-V virtual machine via PowerShell | |
# ------------------------------------------------------------ | |
# Variables | |
$VM_NAME = "PS_TEST_VM" | |
$VM_MAC = "00:15:5d:11:22:01" | |
$VM_RAM = 256GB | |
$VM_CPUS = 16 |
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 graphene | |
class FileUpload(graphene.Scalar): | |
@staticmethod | |
def serialize(value): | |
return None | |
@staticmethod |
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
#!/bin/bash | |
# Version tag needs to be dependent on all the files that will affect | |
# the generated image. Currently, only the dockerfile and Python | |
# requirements. | |
VERSION_TAG="$( sha1sum Dockerfile requirements/*.txt | sha1sum | cut -d' ' -f1 )" | |
echo "Image version: ${VERSION_TAG}" | |
echo "Commit SHA1: ${CIRCLE_SHA1}" |
NewerOlder