Skip to content

Instantly share code, notes, and snippets.

Dmitry Vasilev scythargon

Block or report user

Report or block scythargon

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
scythargon /
Created Jun 22, 2018
Simple Flask application to demonstrate the Google Speech API usage.
#!/usr/bin/env python
Simple Flask application to demonstrate the Google Speech API usage.
Install the requirements first:
`pip install SpeechRecognition flask`
Then just run this file, go to
and upload an audio (or may be even video) file there, using the html form.
(I've tested it with a .wav file only - relying on Google here).
View nginx stream ffmpeg on the fly
user www-data;
worker_processes auto;
pid /run/;
events {
worker_connections 768;
# multi_accept on;
http {
View gist:382ea24d8c85ef5f4a5e
# chkconfig: 345 96 4
# Source function library.
. /etc/init.d/functions
View python3 subprocess stdin stdout communication
import sys
from subprocess import Popen, PIPE
with Popen([sys.executable, ""], stdout=PIPE, stdin=PIPE, bufsize=1,
universal_newlines=True) as p:
for line in sys.stdin:
line = line.rstrip('\n')
print(line, file=p.stdin, flush=True)
View self maintained queue
from queue import Queue
import threading
class GeneratedQueue(Queue):
for item in q.each():
View BulletProof
class BulletProof(object):
def __getattribute__(self, name):
if name == '__class__':
return super(BulletProof, self).__getattribute__(name)
return BulletProof()
def __str__(self):
return ''
b = BulletProof()
View grunt is for hipsters
$(cd pages && python -m SimpleHTTPServer ) &
while true; do
change=$(inotifywait -r -e close_write,moved_to,create templates/*)
change=${change#./templates/* }
(./ && echo -e "\033[1;32mtemplate recompiled\033[0m") || echo -e "\033[1;31merror!\033[0m"
View gist:589fdf8cf5b8b435c680
<!DOCTYPE html>
<meta charset="UTF-8">
<title>CodePen - Modern HTML5 Lightbox in 12 Lines of JavaScript</title>
dialog {
position: fixed;
left: 50%;
View vk likers city filter
# -*- coding: utf-8 -*-
import sys
import vkontakte
import sys
import ipdb
View gist:9949835
def get_chained_select_choices(content_type, depth=1, with_field_types=False):
""" Gets field names from the content_type.
depth=1 means return any fk or manytomany fields as well
TODO: depth>1 is not implemented yet
if depth > 1:
raise Exception("depth should be 0 or 1")
# helpers
model_klass = content_type.model_class()
You can’t perform that action at this time.