Skip to content

Instantly share code, notes, and snippets.

View omgbbqhaxx's full-sized avatar
🪐
Universal

Yasin Aktimur omgbbqhaxx

🪐
Universal
View GitHub Profile
pragma solidity ^0.4.23;
//1,45 left. -*-*-*-*- 45 55 programmer. -*-*-*-*-*-upper 35 right.
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
address[] public sellers;
mapping (address => uint256) public arrayIndexes;
function addAddress(address _addr) public {
uint id = sellers.length;
arrayIndexes[_addr] = id;
sellers.push(_addr);
}
function removeAddress(address _addr) public {
uint id = arrayIndexes[_addr];
@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."
pragma solidity ^0.4.17;
contract SimpleMiner {
string private myFirstParameter;
bytes private fistByte;
[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
# 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:
#
@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
{
"code": "HNGR",
"name": "Hungr Coin Token",
"desc": "Made your order with hungr ",
"conditions": ""
}
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
@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())
}