Skip to content

Instantly share code, notes, and snippets.

@pleshevskiy
pleshevskiy / revision.py
Created August 17, 2018 07:46
Alembic migrate enum
from alembic import op
from sqlalchemy.dialects.postgresql import ENUM
from sqlalchemy import Column
def upgrade():
enum = ENUM("one", "two", "three", name="pgenum", create_type=False)
enum.create(op.get_bind(), checkfirst=False)
op.create_table("sometable",
Column("data", enum)
)
@pleshevskiy
pleshevskiy / configure.sh
Created May 29, 2018 08:45
Configuration of Ubuntu
sudo dpkg-reconfigure tzdata
@pleshevskiy
pleshevskiy / configurate_postgresql.sql
Last active May 29, 2018 08:11
Configuration of postgesql
ALTER DATABASE mauna SET TIMEZONE 'Europe/Moscow';
@pleshevskiy
pleshevskiy / rAF.js
Last active August 25, 2015 19:42 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];