Skip to content

Instantly share code, notes, and snippets.

View index.html
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<title>Home</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<section id="id_about_section">
@DrMartiner
DrMartiner / default.conf
Created Sep 18, 2018
docker-compose.yml Nginx sslforfree.com
View default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
location / {
root /usr/share/nginx/html;
}
}
View btc_send.py
from pywallet import wallet
from transactions import Transactions
from bitcoinrpc.authproxy import AuthServiceProxy
BITCOIND_JSON_RPC_URL = 'http://user:pass@host:8332'
def create_wallet(seed: str=None, network: str='BTC', children=0) -> dict:
""" Step 1 """
if not seed:
@DrMartiner
DrMartiner / push_tx.py
Last active Feb 3, 2018
Use https://github.com/richardkiss/pycoin to create a wallet & make a transaction to testnet
View push_tx.py
import os
import requests
os.environ.setdefault('PYCOIN_DEFAULT_NETCODE', 'XTN')
os.environ.setdefault('PYCOIN_XTN_PROVIDERS', 'chain.so')
from pycoin.key.electrum import ElectrumWallet
from pycoin.tx.tx_utils import (create_tx, sign_tx)
from pycoin.services import spendables_for_address
@DrMartiner
DrMartiner / profit.py
Created Dec 12, 2017
Poloniex profit monitor
View profit.py
from datetime import datetime
from time import sleep
from colorclass import Color
from poloniex import Poloniex
from terminaltables import AsciiTable
API_KEY = ""
API_SECRET = ''
polo = Poloniex(API_KEY, API_SECRET)
@DrMartiner
DrMartiner / backup_file_fields.py
Last active Oct 22, 2017
Command for backups all media files
View backup_file_fields.py
import os
import tarfile
import progressbar
import django.apps
from datetime import datetime
from django.core.management.base import BaseCommand
from django.utils.encoding import smart_str
class Command(BaseCommand):
@DrMartiner
DrMartiner / put_pos.py
Created Jul 20, 2017
Put po files to shuup project
View put_pos.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import shutil
SHUUP_PATH = '~/.pyenv/versions/project/lib/python3.5/site-packages/shuup'
SOURCE_PATH = '~/projects/project'
@DrMartiner
DrMartiner / urls.py
Created May 12, 2017
Django's URL's error handlers
View urls.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
urlpatterns = [
# ...
]
handler400 = 'apps.common.views.handler400'
handler403 = 'apps.common.views.handler403'
@DrMartiner
DrMartiner / middleware.py
Last active Mar 19, 2017
Create session for anonymous django users
View middleware.py
# -*- coding: utf-8 -*
from __future__ import unicode_literals
import logging
from django.conf import settings
from importlib import import_module
engine = import_module(settings.SESSION_ENGINE)
SessionStore = engine.SessionStore
You can’t perform that action at this time.