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
import math | |
import time | |
s = math.sin | |
q = math.sqrt | |
i = lambda a, b, c: a in range(b, c) | |
def c(x, y): | |
# http://www.purplemath.com/modules/distform.htm | |
t = time.time() * 1000 / 74 |
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
;; mkdir -p $HOME/.emacs.d/themes \ | |
;; && mkdir -p $HOME/.emacs.d/lisp \ | |
;; && wget https://raw.githubusercontent.com/lvm/monochrome-theme.el/master/monochrome-transparent-theme.el -O $HOME/.emacs.d/themes/monochrome-transparent-theme.el | |
(require 'package) | |
(custom-set-variables | |
'(package-archives | |
(quote | |
(("gnu" . "http://elpa.gnu.org/packages/") | |
("melpa-stable" . "http://stable.melpa.org/packages/"))))) |
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 flatten(dct: dict, , prefix="", glue: str = "__") -> dict: | |
flat = {} | |
prefix = f"{prefix}{glue}" if prefix else "" | |
def _flat(dct): | |
_dct = {} | |
for k, v in dct.items(): | |
if not isinstance(v, list) and not isinstance(v, dict): | |
_dct[k] = v |
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 | |
import re | |
import eyed3 | |
import shlex | |
import string | |
import argparse | |
import youtube_dl | |
import subprocess as sp | |
from pathlib import Path |
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 | |
import shlex | |
import argparse | |
import youtube_dl | |
import subprocess as sp | |
from pathlib import Path | |
from youtube_dl.utils import sanitize_filename | |
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
from .models import Post, Category | |
from .decorators import action_form | |
class PostCategoryForm(forms.Form): | |
title = 'Update category for the selected posts' | |
category = forms.ModelChoiceField(queryset=Category.objects.all()) | |
@admin.register(Post) |
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 | |
import argparse | |
from pathlib import Path | |
def get_dirs(path): | |
return dict([(x.name,x.as_posix()) | |
for x in path.iterdir() | |
if x.is_dir()]) |
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
z = SimpleMIDIFile.read("/home/mauro/Downloads/General MIDIMan - Ageispolis.mid") | |
( | |
x = { |smf, channel, track| | |
var pending = IdentitySet.new, buf = MIDIRecBuf(\seq).absoluteOnsets_(true), | |
events = smf.noteEvents(channel, track).sort { |a, b| | |
if(a[1] == b[1]) { | |
a[2] > b[2] // equal time, put noteOn first | |
} { | |
a[1] < b[1] // earlier time first | |
} |
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
+ Symbol { | |
args { | |
^SynthDescLib.global.at(this); | |
} | |
function { | |
^SynthDescLib.global.at(this).def.func; | |
} |
NewerOlder