Skip to content

Instantly share code, notes, and snippets.

View rapthead's full-sized avatar

Павел Грибанов rapthead

  • Russia, Chelabinsk
View GitHub Profile
@sandcastle
sandcastle / guid.ts
Last active February 18, 2018 04:33
A useful type GUID class definition.
const GUID_EMPTY: string = '00000000-0000-0000-0000-000000000000';
const GUID_FORMAT: RegExp = /\{?([a-z0-9]{8}(?:-[a-z0-9]{4}){3}-[a-z0-9]{12})\}?/i;
/**
* A unique identifier.
*/
export class Guid {
private _id: string;
@bforchhammer
bforchhammer / lazy_batching.py
Last active February 18, 2017 08:56
Graphene lazy batched requests
from graphql.execution.executors.sync import SyncExecutor
"""
Usage example:
from functools import partial
class MyServiceCache(BulkRequestCache):
def __init__():
self.requested_values = set()
@maorv
maorv / create_neovim_qt_deb.sh
Last active March 23, 2021 19:21
Install neovim-qt on ubuntu
#!/bin/sh
echo "Install neovim from ppa"
sudo add-apt-repository -y ppa:neovim-ppa/unstable
sudo apt-get update
sudo apt-get install -y neovim
sudo apt install qt5-default libqt5widgets5
echo "Compile and install neovim-qt"
git clone https://github.com/maorv/neovim-qt.git
@dtheodor
dtheodor / listen_sqla.py
Last active February 17, 2025 19:04
Listen for pg_notify with SQL Alchemy + Psycopg2
import select
import datetime
import psycopg2
import psycopg2.extensions
from sqlalchemy import create_engine, text
engine = create_engine("postgresql+psycopg2://vagrant@/postgres")