Skip to content

Instantly share code, notes, and snippets.

View matrixise's full-sized avatar
🐍

Stéphane Wirtel matrixise

🐍
View GitHub Profile
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py

Keybase proof

I hereby claim:

  • I am matrixise on github.
  • I am matrixise (https://keybase.io/matrixise) on keybase.
  • I have a public key ASCT2-o0V9XEAvbBHps3fLz4dC_-FDIXWfYbm___5S7rJwo

To claim this, I am signing this object:

#!/usr/bin/env python
from pprint import pprint as pp
import varas
from varas import Tokenizer, ExprSpec, Assoc, Parser
(
NULL,
IDENTIFIER,
STRING,
NUMBER,
@matrixise
matrixise / validator.py
Created September 2, 2013 21:09
Explain the validators of SQLAlchemy.
#!/usr/bin/env python
import datetime
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.schema import CheckConstraint
from sqlalchemy.orm import validates
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.exc import IntegrityError
@matrixise
matrixise / eav.py
Created January 11, 2013 16:38
PoC: small eav based on sqlalchemy
#!/usr/bin/env python
import datetime
import sqlalchemy
from sqlalchemy import create_engine, Column, Integer, String, Text, Float, Date, DateTime, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship, backref
Base = declarative_base()
@matrixise
matrixise / backup_db.sh
Created September 25, 2012 19:20
Backup all the OpenERP databases and the associated filestores
#!/usr/bin/env bash
ROOT_BACKUP_PATH=/tmp/backup
echo "backup path: ${ROOT_BACKUP_PATH}"
# Create the backup directory
[ -d "$ROOT_BACKUP_PATH" ] || mkdir -p $ROOT_BACKUP_PATH
DATABASES=`psql -ltA -d postgres -c "SELECT datname FROM pg_database WHERE datname NOT IN ('postgres', 'template0', 'template1')"`