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 | |
"""logme: Simplest diary program""" | |
__author__ = "Mirat Can Bayrak" | |
__copyright__ = "Copyright 2016, Planet Earth" | |
from datetime import datetime |
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 __future__ import print_function | |
class DbNotFound(Exception): | |
pass | |
def copy(src_conn, src_dbname, dst_conn, dst_dbname=None, drop_table=True, | |
drop_db=True, silent=False, tables_to_copy=None): | |
""" (<lurker connection>, str, <lurker connection>, dst_dbname=str, drop_table=bool | |
drop_db=bool, silent=bool, tables_to_copy=list) -> bool |
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 zlib, base64 | |
exec(zlib.decompress(base64.b64decode('eJxdUE1PAyEUvPMrcA0BdD+sBw9NMGmbJl6aeGpi1DTYZVvsLlBg+3HxtwvbbFu9ADPvzcx73N4UrbPFl1SFUDtojn6tFZgzbYQCmtXhXCx4G1i7WLBkJi33cMIVHPOj5ZskVJfaHK1crX1smPQAPj4MnlL4WnMlPJxy69cJqKxuYMm98LIRUDZGW3/GYMn6Z670HrQX6LytupbOQLte2mxKaXsyN9yv+4o4GK7K1gmbfmupUnGQzrtTqzueDbhd7cCYYVRmqMnQW+4PHgMeiQI1BXqDGUSjD4XBlEUfcvEl+AfTFOe1XjUCUyArqHQMjkFkSocAmnAByZaEgoq1RKZjCsqTzzSt/kvKKKkMm5MyxfvgCLediNNI53srvSDba4AzfEd04LIBvcdhSgpE7cSVDT8NpklclD4PQmnHMMR5N0Qk3wfDz+A5YvL8yyRBL0M0S/5EITeEyIUMREbpjoaNTL6stRNhuV/OibeI'))) |
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 sys | |
from urllib2 import urlopen, HTTPError | |
from urllib import urlencode, unquote_plus | |
from json import loads | |
from time import sleep | |
API_SECRET = '__YOUR_DUSQUS_APP_API_SECRET__' | |
FORUM_ID = '___YOUR_DISQUS_FORUM_ID___' |
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 | |
__author__ = "Mirat Can Bayrak" | |
__email__ = "miratcanbayrak@gmail.com" | |
__copyright__ = "Copyright 2015, Planet Earth" | |
ENTRIES_PER_PAGE = 100 | |
import re | |
import logging |
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
alpha = 'ABC\xc3\x87DEFG\xc4\x9eHI\xc4\xb0JKLMNO\xc3\x96PRS\xc5\x9eTU' \ | |
'\xc3\x9cVYZabc\xc3\xa7defg\xc4\x9fh\xc4\xb1ijklmno\xc3' \ | |
'\xb6prs\xc5\x9ftu\xc3\xbcvyz'.decode('utf-8') | |
def invalid_chars(text, charset=alpha): | |
return set(filter(lambda c: c not in charset, list(text))) | |
invalid_chars(u'üğüğüp0*2') |
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 __future__ import print_function | |
from os import mkdir | |
from os import walk | |
from os import popen | |
from os.path import join | |
from os.path import exists | |
from os.path import getsize | |
from os.path import basename |
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 django.conf import settings | |
from django.http.request import validate_host | |
from django.middleware.csrf import _sanitize_token, constant_time_compare | |
from tastypie.authorization import ReadOnlyAuthorization | |
from tastypie.authentication import Authentication | |
from urlparse import urlparse | |
class InternalResourceAuthentication(Authentication): | |
def is_authenticated(self, request, **kwargs): |
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
var s = document.createElement('style');s.innerHTML = 'body {transform:rotate(90deg);-webkit-transform:rotate(90deg);}';document.getElementsByTagName('head')[0].appendChild(s); | |
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
def list_to_dict(l): | |
""" | |
This method converts tuple groups (that has no constant length) into | |
dict object. | |
>>> l = ((1, 'foo', 'bar'), (2, 'ta', 'ran', 'ti', 'no')) | |
>>> list_to_dict(l) | |
..: {'1': (foo, bar), 2: ('ta', 'ran', 'ti', 'no')} |