Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Emre Yılmaz emre

🎯
Focusing
View GitHub Profile
View gist:a33c566a527fab2e39d8568797b7f94d
log-appender = {"appender":"stderr","stream":"std_error"} {"appender":"p2p","file":"logs/p2p/p2p.log"}
log-logger = {"name":"default","level":"info","appender":"stderr"} {"name":"p2p","level":"warn","appender":"p2p"}
backtrace = yes
plugin = webserver p2p json_rpc witness account_by_key reputation market_history
plugin = database_api account_by_key_api network_broadcast_api reputation_api
plugin = market_history_api condenser_api block_api rc_api
history-disable-pruning = 0
account-history-rocksdb-path = "blockchain/account-history-rocksdb-storage"
View keybase.md

Keybase proof

I hereby claim:

  • I am emre on github.
  • I am emrebeyler (https://keybase.io/emrebeyler) on keybase.
  • I have a public key ASCTYcWUVTTA50dn1Uzn-PZKVd2F0PBXfMLxng0BoTdj2Qo

To claim this, I am signing this object:

View sm_giveaway.py
import requests
from lightsteem.client import Client
import random
def get_proxy_votes(c, username):
account_detail = c.get_accounts([username])[0]
if account_detail["proxy"]:
# print(f"proxy found, checking {account_detail['proxy']}")
return get_proxy_votes(c, account_detail["proxy"])
@emre
emre / interview_questions.md
Last active Jul 8, 2019
Python interview questions
View interview_questions.md

What will be the output? (LUX)

c = 3

def add():
    c = c + 2
    return c
    
View last_head_test.py
import requests
def test_last_head():
appbase_node = "https://api.steemit.com"
global_properties = requests.post(
appbase_node,
json={
"jsonrpc": "2.0",
@emre
emre / producer_rewards.py
Last active Mar 14, 2018
producer_rewards
View producer_rewards.py
from steem import Steem
from steem.account import Account
from steem.amount import Amount
from steem.converter import Converter
import logging
logger = logging.getLogger('producer rewards')
logger.setLevel(logging.INFO)
logging.basicConfig()
@emre
emre / account_creator.py
Created Mar 2, 2018
account_creator.py
View account_creator.py
from steem import Steem
from steembase.account import PasswordKey
def create_account(steemd_instance, new_account, new_account_master_key, creator):
steemd_instance.create_account(
new_account,
delegation_fee_steem="1 STEEM",
password=new_account_master_key,
creator=creator,
View producer_reward_history.js
const steem = require('steem');
function getHistory(account, from, limit, reward, opCount) {
steem.api.getAccountHistory(account, from, limit, function (err, result) {
if (err) {
console.log('ERR');
console.log(err);
return
}
@emre
emre / utils.py
Created Nov 23, 2017
up-to-date voting power calculation (steem-python)
View utils.py
from dateutil.parser import parse
from datetime import datetime
def get_voting_power(account_data):
last_vote_time = parse(account_data["last_vote_time"])
diff_in_seconds = (datetime.utcnow() - last_vote_time).seconds
regenerated_vp = diff_in_seconds * 10000 / 86400 / 5
total_vp = (account_data["voting_power"] + regenerated_vp) / 100
if total_vp > 100:
@emre
emre / room_category_logic.py
Created Jun 16, 2017
room category logic.py
View room_category_logic.py
category_tuples = [
CategoryTuple(priority=7,
name='Villa',
excluded=['dorm', 'bunk', 'shared', 'dormitory', 'bunkbed',
'bunk bed', 'shared facility'],
included=['villa']),
CategoryTuple(priority=6,
name='Apartment',
excluded=['dorm', 'bunk', 'shared', 'villa', 'dormitory',
'bunkbed', 'bunk bed', 'shared facility'],
You can’t perform that action at this time.