Skip to content

Instantly share code, notes, and snippets.

@Fak3
Fak3 / manual.md
Last active August 29, 2015 14:19 — forked from laanwj/manual.md

SynthV1 manual

synthv1 is an old-school all-digital 4-oscillator subtractive polyphonic synthesizer with stereo fx. It is developed by rncbc aka Rui Nuno Capela.

The synthesizer consists of two identical "synths" with each two oscillators and associated filters and envelope controls. The outputs of these synths are mixed together for the final output.

Synth modules

@Fak3
Fak3 / choices.py
Last active October 8, 2015 21:58
Choices without metaclass
import inspect
#y
class Choice(object):
def __init__(self):
self._data = []
for name, value in inspect.getmembers(self):
if not name.startswith("_") and not inspect.isfunction(value):
if isinstance(value,tuple) and len(value) > 1:
data = value
@Fak3
Fak3 / cbr_soap.py
Created March 16, 2016 16:18
cbr_soap.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from datetime import datetime, timedelta
from dateutil.parser import parse as parse_dt
from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor
@Fak3
Fak3 / high_label.py
Created June 16, 2016 18:10
Issue with kv Builder - <HighLabel> rule does not override defined <Label> properies
from kivy.lang import Builder
from kivy.uix.label import Label
Builder.load_string('''
<HighLabel>:
text: 'height dp(40)'
height: dp(40)
''')
@Fak3
Fak3 / parse_okruga.py
Created August 24, 2016 19:53
okruga-spb
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pandas import read_csv
csv = read_csv('doma_uik_okruga.csv')
with open('uiks_by_duma.json', 'w+') as file:
file.write(csv.groupby('округ Дума')['УИК'].unique().to_json())
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from pandas import read_csv
csv = read_csv('doma_uik_okruga.csv')
for raion, rdata in csv[csv['округ Дума']==216].groupby(['Район']):
print('\n РАЙОН', raion)
for ulica, udata in rdata.groupby('Улица'):
@Fak3
Fak3 / ramhog.py
Created December 31, 2018 17:53
ramhog.py
from time import sleep
print('Press ctrl-c to exit; Press enter to hog 100MB more')
one = b'Z' * 1024 * 1024 # 1MB
hog = []
while True:
hog.append(one * 100) # allocate 100MB
free = '; '.join(open('/proc/meminfo').read().split('\n')[1:3])
@Fak3
Fak3 / gist:c4c7e2e036ba102dac337b193ee28820
Created March 24, 2019 08:18
/proc/vmstat after almost hanging
nr_free_pages 1936576
nr_zone_inactive_anon 38027
nr_zone_active_anon 671492
nr_zone_inactive_file 151489
nr_zone_active_file 69616
nr_zone_unevictable 8
nr_zone_write_pending 5758
nr_mlock 8
nr_page_table_pages 6801
nr_kernel_stack 10144
def streamdup(stream, filename, mode='a+'):
"""
Aka "tee".
Duplicate stream output to the file with given name.
Usage:
>>> streamcopy(sys.stderr, 'myfile', 'a+')
"""
stream._tee = open(filename, mode)
@Fak3
Fak3 / m3u8-to-mp4.md
Created May 27, 2019 17:26 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4