This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
you: Y UW1 => यू | |
I: AY1 => आय | |
to: T UW1 => टू | |
the: DH AH0 => दै | |
a: AH0 => ऐ | |
and: AH0 N D => ऐन्ड | |
that: DH AE1 T => दैट | |
it: IH1 T => इट | |
of: AH1 V => आव | |
me: M IY1 => मी |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.Cipher import AES | |
from Crypto import Random | |
import base64 | |
import binascii | |
import struct | |
from django.db import models | |
from django.conf import settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DEFAULT_GOAL := help | |
node_modules: ## Install dependencies. | |
node_modules: package.json | |
npm install | |
help: ## Show this help. | |
@IFS=$$'\n' ; \ | |
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \ | |
for help_line in $${help_lines[@]}; do \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
preexec () { | |
START="$(python -c 'import time; print time.time()')" | |
LAST_CMD=$1 | |
} | |
precmd () { | |
LAST=$? | |
if [ -z ${START} ]; | |
then | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CICharField(models.CharField): | |
def db_type(self, connection): | |
assert connection | |
return 'CITEXT' | |
def from_db_value(self, value, expression, connection, context): | |
if value and isinstance(value, str): | |
value = value.decode("utf-8") | |
return value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Function: clone_schema(text, text) | |
-- DROP FUNCTION clone_schema(text, text); | |
CREATE OR REPLACE FUNCTION clone_schema( | |
source_schema text, | |
dest_schema text, | |
include_recs boolean) | |
RETURNS void AS | |
$BODY$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH query_stat AS ( | |
SELECT | |
relname, 100 * idx_scan / (seq_scan + idx_scan) percent_of_times_index_used, | |
n_live_tup rows_in_table, idx_scan, seq_scan | |
FROM | |
pg_stat_user_tables | |
WHERE | |
seq_scan + idx_scan > 0 | |
ORDER BY | |
seq_scan DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, traceback | |
class ImportBlocker(object): | |
def find_module(self, fullname, path=None): | |
if "mobil" in fullname and "mobile" not in fullname: | |
print fullname | |
print traceback.print_stack() | |
raise Exception() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find the list of backup files | |
# for each file see the position till where we have read the file from "stack" | |
# for each file see if there is more in it. | |
# if there is more, start reading and writing to keen | |
# find total size of all files | |
# go thru in ls -t order so we always traverse them in same order | |
from progressbar import ProgressBar | |
import keen, pdb, json, time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from importd import d | |
from path import path | |
from datetime import datetime | |
from djangothis.app import dotslash, read_yaml, watchfile | |
from django.shortcuts import render | |
posts = None | |
labels = {} |