Skip to content

Instantly share code, notes, and snippets.


Goran Skoljarev gskoljarev

View GitHub Profile
gskoljarev /
Created Jul 19, 2018
Split .flac files via .cue file
shnsplit -f file.cue -t %n-%t -o flac file.flac
gskoljarev /
Last active Mar 22, 2017 — forked from carymrobbins/
Django - Execute a raw query and return a QuerySet
from django.db import connection, models
class MyManager(models.Manager):
def raw_as_qs(self, raw_query, params=()):
"""Execute a raw query and return a QuerySet. The first column in the
result set must be the id field for the model.
:type raw_query: str | unicode
:type params: tuple[T] | dict[str | unicode, T]
:rtype: django.db.models.query.QuerySet
gskoljarev /
Last active Jun 13, 2020
Python implementation of Ramer-Douglas-Peucker (RDP) algorithm; ported from JavaScript code at; uses desired number of points instead of using a threshold.
# -*- coding: utf-8 -*-
import math
import time
def timenow():
return int(time.time() * 1000)
def sqr(x):