Skip to content

Instantly share code, notes, and snippets.

View omgbbqhaxx's full-sized avatar
🪐
Universal

Yasin Aktimur omgbbqhaxx

🪐
Universal
View GitHub Profile
//
// PageVC.swift
// PageViewControllerTutorial
//
// Created by Volodymyr Romanov on 10/10/16.
// Copyright © 2016 Vladimir Romanov. All rights reserved.
//
import UIKit
def sign_data(private_key_loc, data):
'''
param: private_key_loc Path to your private key
param: package Data to be signed
return: base64 encoded signature
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
from base64 import b64encode, b64decode
@omgbbqhaxx
omgbbqhaxx / DownloadAndPlay.swift
Created September 21, 2017 00:11 — forked from wuyongrui/DownloadAndPlay.swift
Download a video and play with AVPlayer,AVPlayerLayer
class ViewController: UIViewController {
private var player:AVPlayer?
private var playerLayer:AVPlayerLayer?
override func viewDidLoad() {
super.viewDidLoad()
print(NSHomeDirectory())
}
def verify_sign(public_key_loc, signature, data):
'''
Verifies with a public key from whom the data came that it was indeed
signed by their private key
param: public_key_loc Path to public key
param: signature String signature to be verified
return: Boolean. True if the signature is valid; False otherwise.
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
{
"code": "HNGR",
"name": "Hungr Coin Token",
"desc": "Made your order with hungr ",
"conditions": ""
}
@omgbbqhaxx
omgbbqhaxx / bitwalletrecover.py
Created February 26, 2018 22:23 — forked from UdjinM6/bitwalletrecover.py
bitwalletrecover.py - recover compressed private keys from your bitcoin/litecoin/darkcoin wallet. Requires python3, pycoin (https://pypi.python.org/pypi/pycoin), and base58 (https://pypi.python.org/pypi/base58).
## bitwalletrecover.py - recover private keys from your darkcoin wallet
## (this version was not tested with bitcoin/litecoin).
## Requires python3, pycoin (https://pypi.python.org/pypi/pycoin),
## and base58 (https://pypi.python.org/pypi/base58).
##
## Starting with Python 3.4, pip is included by default with the Python binary
## installers. To install pip for older versions 3.x:
##
## sudo apt-get install python3-setuptools
## sudo easy_install3 pip
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
pragma solidity ^0.4.17;
contract SimpleMiner {
string private myFirstParameter;
bytes private fistByte;
@omgbbqhaxx
omgbbqhaxx / bitcoin_block_difficulty_analysis.py
Created April 17, 2018 23:55 — forked from jackschultz/bitcoin_block_difficulty_analysis.py
Showing of Bitcoin's Proof of Work difficulty is calculated and changed.
import datetime
###################################################################
#
# Showing the way bits, difficulty, target, and hash work together.
#
###################################################################
print "Calculating target from bits, verifying the block's hash is valid, and verify the calculated difficulty."