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
name: Test Workflow | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
image: postgres |
Table of Contents:
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
/* ========================================= | |
IMPORTS | |
-------------------------------------- */ | |
const fs = require('fs') | |
const { promisify } = require('util') | |
sleep = promisify(setTimeout) |
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
/* ============================================= | |
Dependencies | |
------------------------------------------ */ | |
const debug = require('debug') | |
const chalk = require('chalk') | |
const { Readable, Writable, Transform, pipeline } = require('stream') |
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 python3 | |
# -*- coding: UTF-8 -*- | |
import socket | |
import json | |
server_address = '/tmp/example.sock' | |
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | |
sock.connect(server_address) |
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
def truncate_db(engine): | |
# delete all table data (but keep tables) | |
# we do cleanup before test 'cause if previous test errored, | |
# DB can contain dust | |
meta = MetaData(bind=engine, reflect=True) | |
con = engine.connect() | |
trans = con.begin() | |
con.execute('SET FOREIGN_KEY_CHECKS = 0;') | |
for table in meta.sorted_tables: | |
con.execute(table.delete()) |
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/python | |
# This is a simple port-forward / proxy, written using only the default python | |
# library. If you want to make a suggestion or fix something you can contact-me | |
# at voorloop_at_gmail.com | |
# Distributed over IDC(I Don't Care) license | |
import socket | |
import select | |
import time | |
import sys |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
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
/** | |
* A diff utility that compares arrays and returns a list of added, removed, and updated items | |
* | |
* Returns an object with two methods: | |
* diff: do a one-time diff of two arrays | |
* watch: observe a variable on scope and report any changes to a callback | |
* | |
* Invoking the factory is done like so: | |
* <code> | |
* function(listDiff) { |
NewerOlder