Skip to content

Instantly share code, notes, and snippets.

Life cannot just be about solving one sad problem after another.

Norman E. NormanEdance

Life cannot just be about solving one sad problem after another.
Block or report user

Report or block NormanEdance

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
DGrady /
Last active Feb 12, 2018
Stream data asynchronously through a subprocess in Python
Problem: provide two-way communication with a subprocess in Python.
See also:
import asyncio
import sys
SammyK /
Last active Apr 3, 2018
Possible syntax for adding the `retry` keyword to PHP

Without retry keyword

try {
	$attempts = 0;
	throw new Exception('Oops!');
} catch (Exception $e) {
	if ($attempts < 4) {
nvgoldin /
Created Jul 27, 2016
Python 3.5 asyncio - shutdown all tasks safely using signal handler
import signal
import functools
async def looping_task(loop, task_num):
while True:
print('{0}:in looping_task'.format(task_num))
await asyncio.sleep(5.0, loop=loop)
except asyncio.CancelledError:
return "{0}: I was cancelled!".format(task_num)
tmilos /
Last active Dec 8, 2019
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

carlaibamford / How to change the default charset to UTF-8 on XAMMP (MySQL)
Created Nov 10, 2014
How to change the default charset to UTF-8 on XAMMP (MySQL)
View How to change the default charset to UTF-8 on XAMMP (MySQL)
1. Open "my.ini" in "C:\xampp\mysql\bin\" directory.
2. Edit the following lines.
# Add the following code before [client].
# Add the following code before [mysqld].
DavidRockin / Mailer.php
Created Aug 2, 2014
PHPMailer save emails to IMAP folder
View Mailer.php
class Mailer extends PHPMailer {
* Save email to a folder (via IMAP)
* This function will open an IMAP stream using the email
* credentials previously specified, and will save the email
* to a specified folder. Parameter is the folder name (ie, Sent)
sinkers /
Created Jul 14, 2014
Script for live video streaming monitoring with notifications
Script to monitor live streams and send an Amazon SNS if the stream is down (and possibly take restorative action)
Black detect: ffmpeg -i out.mp4 -vf blackdetect -f null -
Note the following doesn't seem to fully work without looking at the debug logs
On live ffmpeg -y -i rtmp:// -vf blackdetect -t 10 -loglevel debug -f null -
vladimirtsyupko / gist:10964772
Created Apr 17, 2014
Git force pull to overwrite local files
View gist:10964772
git fetch --all
git reset --hard origin/master
git pull origin master
mobilemind /
Last active Dec 11, 2019
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
You can’t perform that action at this time.