Skip to content

Instantly share code, notes, and snippets.

View vovanbo's full-sized avatar
💭
I am

Vladimir Bolshakov vovanbo

💭
I am
View GitHub Profile
@tobek
tobek / rip-dvd-chapters.sh
Created October 19, 2020 23:16
Rip and encode individual titles and chapters from DVD or ISO
#!/bin/bash
set -eo pipefail
shopt -s expand_aliases
alias ffmpeg='ffmpeg -hide_banner'
usage()
{
cat << EOF
@fabiolimace
fabiolimace / UUIDv6.sql
Last active May 11, 2025 12:04
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@rob-murray
rob-murray / UK Company Number regex
Last active February 19, 2025 12:05
A regex to check UK Company numbers - ie the reference assigned to companies in the UK via Companies House
/^((AC|ZC|FC|GE|LP|OC|SE|SA|SZ|SF|GS|SL|SO|SC|ES|NA|NZ|NF|GN|NL|NC|R0|NI|EN|\d{2}|SG|FE)\d{5}(\d|C|R))|((RS|SO)\d{3}(\d{3}|\d{2}[WSRCZF]|\d(FI|RS|SA|IP|US|EN|AS)|CUS))|((NI|SL)\d{5}[\dA])|(OC(([\dP]{5}[CWERTB])|([\dP]{4}(OC|CU))))$/
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
@caseywatts
caseywatts / 0 README.md
Last active December 11, 2024 05:12
d3 & c3 npm shim to es6 module for Ember
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aleneum
aleneum / example.py
Last active April 10, 2019 15:03
this gist was done to evaluate how django and transitions could work together and is based on work from jxskiss. See his [gist](https://gist.github.com/jxskiss/01816eec9a2b64bae341f4d07f58646e) for more details.
# add the other files to your django app and migrate
# enter django shell with python manage.py shell and execute the following
# I called my app 'issues'; so change issues to your app name in case you choose another one
# there are 5 models which realize state machine bindings to django models in different ways
# Item: add a transitions.Machine instance to each record/item
# ItemSingleton: add each model to a global transitions.Machine
# ItemSingletonSet: Extend transitions.Machine to use set instead of list to store models; this increases look up speed in add_model
# ItemNoMachine: just a minimal model without a state machine (for referencing purposes)
# ItemFysom: add a customized fysom machine to each record/item
@jxskiss
jxskiss / example.py
Last active May 23, 2022 07:55
Use "fysom" state machine as global machine
from django.db import models
from fysom_singleton import *
class ItemStatus(object):
NEW = 'new'
NEED_INFO = 'need_info'
REVIEWING = 'reviewing'
REDOING = 'redoing'
CONFLICT = 'conflict'
@yumike
yumike / middleware.py
Last active August 23, 2018 14:29
cian-statprof
# coding: utf-8
from cian_statprof.profiler import Profiler
from cian_statprof.sampler import Sampler
profiler = Profiler(Sampler(), Logger(), {'is_enabled': True})
class StatisticalProfilerMiddleware(object):
def process_request(self, request):