Skip to content

Instantly share code, notes, and snippets.

View creotiv's full-sized avatar

Andrey Nikishaev creotiv

View GitHub Profile
import time
from hashlib import sha256
from merkletools import MerkleTools
from .wallet import Address
class Input:
__slots__ = 'prev_tx_hash', 'output_index', 'signature', '_hash', 'address', 'index', 'amount'
import rsa
import binascii
class Address:
def __init__(self, addr):
if isinstance(addr, rsa.PublicKey):
self.addr = addr
else:
if isinstance(addr,str):
from sklearn.datasets import make_blobs
from collections import defaultdict
# Generate sample data
n_samples = 4000
n_components = 4
X, y_true = make_blobs(n_samples=n_samples,
centers=n_components,
cluster_std=0.99,
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
# Load the diabetes dataset
diabetes_X, diabetes_y = datasets.load_diabetes(return_X_y=True)
# Use only one feature
diabetes_X = diabetes_X
import torch
import torch.nn as nn
import torch.nn.functional as F
class Conv2d(nn.Module):
def __init__(self, inch, outch, kernel, padding=0, stride=1):
super(Conv2d, self).__init__()
# setting our kernels with random normal
@creotiv
creotiv / linkedin.js
Created March 17, 2021 14:17
select all messages
var a = document.querySelectorAll('.msg-selectable-entity');for (var i=0;i<=a.length;i++){a[i].click();};
@creotiv
creotiv / MLRunner.md
Last active April 15, 2021 09:41
Script to run ml code from git in parallel without changing branch

Use

./ml.sh -b master python3 test.py

sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -a -G docker $USER
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az login --identity
resource "azurerm_storage_account" "funcsta" {
name = "${local.storage_account_name}"
resource_group_name = "${var.resource_group_name}"
location = "${var.location}"
account_tier = "Standard"
account_replication_type = "${var.account_replication_type}"
enable_blob_encryption = "true"
enable_file_encryption = "true"
tags = "${merge(var.tags, map("environment", var.environment), map("release", var.release))}"
#Main function
Function GetWin8Key
{
$Hklm = 2147483650
$Target = $env:COMPUTERNAME
$regPath = "Software\Microsoft\Windows NT\CurrentVersion"
$DigitalID = "DigitalProductId"
$wmi = [WMIClass]"\\$Target\root\default:stdRegProv"
#Get registry value
$Object = $wmi.GetBinaryValue($hklm,$regPath,$DigitalID)