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
import logging | |
from logging.config import dictConfig | |
# adding custom level | |
logging.VERBOSE = 5 | |
logging._levelNames.update({ | |
5: 'VERBOSE', | |
'VERBOSE': 5, | |
}) |
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
__author__ = 'Bojan Delic <[email protected]>' | |
__date__ = 'Jan 11, 2013' | |
__copyright__ = 'Copyright (c) 2013 Bojan Delic' | |
class DependencyGraphException(Exception): pass | |
class Node(object): | |
''' Represents single node in graph ''' | |
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
# NOTE: Change this to random numbers in range (0, 255) inclusive | |
_key = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | |
_vector = [0, 0, 0, 0, 0, 0, 0, 0, | |
0, 0, 0, 0, 0, 0, 0, 0] | |
from System import Array, Byte | |
from System.Text import UTF8Encoding | |
from System.IO import MemoryStream |
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
[ | |
{ "city" : "Beograd", "_id" : 11000 }, | |
{ "city" : "Beograd Vozdovac", "_id" : 11010 }, | |
{ "city" : "Beograd Čukarica", "_id" : 11030 }, | |
{ "city" : "Beograd Zvezdara", "_id" : 11050 }, | |
{ "city" : "Beograd Palilula", "_id" : 11060 }, | |
{ "city" : "Novi Beograd", "_id" : 11070 }, | |
{ "city" : "Beograd Zemun", "_id" : 11080 }, | |
{ "city" : "Beograd Rakovica", "_id" : 11090 }, | |
{ "city" : "Kaluđerica", "_id" : 11130 }, |
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
# | |
# Copyright (C) 2013 Vinay Sajip. New BSD License. | |
# | |
import os | |
import os.path | |
from subprocess import Popen, PIPE | |
import sys | |
from threading import Thread | |
from urllib.parse import urlparse | |
from urllib.request import urlretrieve |
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
SELECT | |
table_schema || '.' || table_name AS table_full_name, | |
pg_size_pretty(pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')) AS size | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
ORDER BY | |
pg_total_relation_size('"' || table_schema || '"."' || table_name || '"') 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
;=============================================================== | |
; Perform action on computer unlock. | |
;=============================================================== | |
;--------------------------------------------------------------- | |
;Notify Lock\Unlock | |
; This script monitors LockWorkstation calls | |
; | |
; If a change is detected it 'notifies' the calling script | |
; On Lock | |
; This script will call function "on_lock()" |
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 http://devhawk.net/2009/04/21/__clrtype__-metaclasses-ironpython-classes-under-the-hood/ | |
import clr | |
clr.AddReference('Microsoft.Scripting.dll') | |
clr.AddReference('Microsoft.Dynamic.dll') | |
clr.AddReference('IronPython.dll') | |
from Microsoft.Scripting.Generation import Snippets | |
from System.Reflection.Emit import OpCodes | |
from System.Reflection import FieldAttributes |
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 delicb on github. | |
* I am delboy (https://keybase.io/delboy) on keybase. | |
* I have a public key whose fingerprint is 4374 1553 56F0 74DD A234 328A 60FF 8E76 F728 19FA | |
To claim this, I am signing this object: |
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/evn python | |
# -*- coding: utf8 -*- | |
import os | |
import struct | |
magics = { | |
20121: 'Python 1.5.x', | |
50428: 'Python 1.6', | |
50823: 'Python 2.0.x', |
OlderNewer