markdown.py
@environmentfilter
def markdown(env, value):
"""
Markdown filter with support for extensions.
"""
try:
import markdown as md
""" | |
Kivy asyncio example app. | |
Kivy needs to run on the main thread and its graphical instructions have to be | |
called from there. But it's still possible to run an asyncio EventLoop, it | |
just has to happen on its own, separate thread. | |
Requires Python 3.5+. | |
""" |
import yaml | |
from yaml.constructor import ConstructorError | |
try: | |
from yaml import CLoader as Loader | |
except ImportError: | |
from yaml import Loader | |
def no_duplicates_constructor(loader, node, deep=False): |
#!/bin/bash | |
line=$(tail -1 /var/log/myapp/myapp.uwsgi.log) | |
substr='uWSGI listen queue of socket' | |
if test "${line#*$substr}" != "$line" | |
then | |
#We're using upstart, could be easily adapted to fx systemd | |
# Adding a log statement to keep track of when this happens. Remember to create the monitor dir | |
/sbin/initctl restart myapp > /var/log/myapp/monitor/uwsgi-monitor.log 2>&1 | |
echo "$(date) restarted myapp due to listen queue error" >> /var/log/myapp/monitor/uwsgi-monitor.log |
#!/usr/bin/perl -w | |
use IO::Socket ; | |
use IO::Handle ; | |
my $host = $ARGV[0] || "localhost"; | |
my $port = $ARGV[1] || 8000; | |
STDERR->autoflush(1); | |
STDOUT->autoflush(1); | |
my $data = ""; |
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options | |
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full. | |
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}… | |
Getting help: | |
-h — print basic options | |
-h long — print more options | |
-h full — print all options (including all format and codec specific options, very long) |
from hashlib import sha256 as sha | |
def chunks(l, n): | |
"""Yield successive n-sized chunks from l.""" | |
for i in range(0, len(l), n): | |
yield l[i:i + n] | |
def m_tree(transactions): | |
"""Takes an array of transactions and computes a Merkle root""" | |
sub_t = [] |
markdown.py
@environmentfilter
def markdown(env, value):
"""
Markdown filter with support for extensions.
"""
try:
import markdown as md
a n | |
ab no | |
aba non | |
abb noo | |
abba noon | |
abib novo | |
abjurer nowhere | |
abl noy | |
abn noa | |
abo nob |
//========================== Open Steamworks ================================ | |
// | |
// This file is part of the Open Steamworks project. All individuals associated | |
// with this project do not claim ownership of the contents | |
// | |
// The code, comments, and all related files, projects, resources, | |
// redistributables included with this project are Copyright Valve Corporation. | |
// Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the | |
// Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo, | |
// Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the |