Skip to content

Instantly share code, notes, and snippets.

View umutcoskun's full-sized avatar
🌴
On vacation

Umut Çağdaş Coşkun umutcoskun

🌴
On vacation
View GitHub Profile
sudo -u postgres psql
-- show running queries
SELECT pid, age(clock_timestamp(), query_start), usename, query FROM pg_stat_activity WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start desc;
static void LogPrint(Object object) async {
int defaultPrintLength = 1020;
if (object.toString().length <= defaultPrintLength) {
print(object);
} else {
String log = object.toString();
int start = 0;
int endIndex = defaultPrintLength;
int logLength = log.length;
int tmpLogLength = log.length;
# Release
$ keytool -genkey -v -keystore KEY_NAME.jks -alias ALIAS_NAME -keyalg RSA -keysize 2048 -validity 10000
# Debug
$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
class ValidatorsTestCase(unittest.TestCase):
def setUp(self):
print('- Test verileri hazırlanıyor...')
self.valid_emails = [
'[email protected]',
'[email protected]',
'[email protected]',
]
def tearDown(self):
import unittest
from validators import validate_email
class ValidatorsTestCase(unittest.TestCase):
def test_validate_email(self):
# Bu format kesinlikle doğru.
self.assertTrue(validate_email('[email protected]'))
import unittest
from validators import validate_email
class ValidatorsTestCase(unittest.TestCase):
def test_validate_email(self):
self.assertTrue(validate_email('[email protected]'))
def validate_email(address):
import re
return bool(re.match(r'[^@]+@[^@]+\.[^@]+', address))
print('Onay kodu gönderildi: *** *** ** *{}'.format(
phone_number[len(phone_number)]
))
@benchmark
@sleep(3)
class User(object):
is_active = True
def __init__(self, name, permissions):
self.name = name
self.permissions = permissions
user = User('umutcoskun', ['can_view_dashboard'])
@sleep(5)
def hello(name):
print('Hello {}'.format(name))
hello('World')
hello('Umut')