Skip to content

Instantly share code, notes, and snippets.

View rterehov's full-sized avatar

Ruslan Terekhov rterehov

  • Gost group
  • Moscow, Russia
View GitHub Profile
@rterehov
rterehov / sqlalchemy-render-query.py
Last active February 23, 2017 08:47
Generate an SQL expression string with bound parameters rendered inline for the given SQLAlchemy statement
from datetime import datetime, date
from sqlalchemy.orm.query import Query
def render_query(statement, bind=None):
"""
Generate an SQL expression string with bound parameters rendered inline
for the given SQLAlchemy statement.
This is some improvement variant of this code:
https://gist.github.com/gsakkis/4572159
@raygunsix
raygunsix / lowerit.sh
Created April 18, 2011 19:20
Converts all file names in the current directory to lower case
#!/bin/sh
# lowerit
# convert all file names in the current directory to lower case
# only operates on plain files--does not change the name of directories
# will ask for verification before overwriting an existing file
# Copied from:
# http://www.linuxjournal.com/content/convert-filenames-lowercase
for x in `ls`