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
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
-- 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
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
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
.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
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
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>com.amitu.waitforit</string> | |
<key>ProgramArguments</key> | |
<array> |
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
### Keybase proof | |
I hereby claim: | |
* I am amitu on github. | |
* I am amitu (https://keybase.io/amitu) on keybase. | |
* I have a public key whose fingerprint is 0AE6 B0E1 9D24 7DD8 4DD0 2BB2 1514 4294 2930 5B79 | |
To claim this, I am signing this object: |