Skip to content

Instantly share code, notes, and snippets.

View null-none's full-sized avatar
🟢
Online

Dmitry Kalinin null-none

🟢
Online
View GitHub Profile
{'addrs': ['0x7Be8076f4EA4A4AD08075C2508e481d6C946D12b', '0x400dD6e072337f81517440b123A845481D964765', '0xE56b8956FC04D120D351FeBBb1bcf1f1949AeA85', '0x0000000000000000000000000000000000000000', '0xBAf2127B49fC93CbcA6269FAdE0F7F31dF4c88a7', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x7Be8076f4EA4A4AD08075C2508e481d6C946D12b', '0xE56b8956FC04D120D351FeBBb1bcf1f1949AeA85', '0x0000000000000000000000000000000000000000', '0x5b3256965e7C3cF26E11FCAf296DfC8807C01073', '0xBAf2127B49fC93CbcA6269FAdE0F7F31dF4c88a7', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000'], 'uints': [750, 0, 0, 0, 192000000000000000, 0, 1644999571, 0, 69843983880094022520410959266187917651181851047858995054328544216871764077938, 750, 0, 0, 0, 192000000000000000, 0, 1644997946, 1645540425, 65122067045700803078713385185273980593558494742643652872239777379967869336469], 'feeMethodsSidesKindsHowToCalls': [1, 0, 0, 1, 1, 1, 0, 1], 'calldataBuy': b'\xfb\x16\
"transaction": {
"accessList": [],
"blockHash": "0x575a9992866220ce5f505814eacaa2def8cc70661e57ae36d045528e920aa12f",
"blockNumber": 14216031,
"chainId": "0x1",
"from": "0x400dD6e072337f81517440b123A845481D964765",
"gas": 332391,
"gasPrice": 67302534794,
"hash": "0xfa49180d65ae3d4df69f0fa49dc6340ed9de2519329fc7121642d04e3d2dcdcf",
"input": "0xab834bab0000000000000000000000007be8076f4ea4a4ad08075c2508e481d6c946d12b000000000000000000000000400dd6e072337f81517440b123a845481d964765000000000000000000000000e56b8956fc04d120d351febbb1bcf1f1949aea850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000baf2127b49fc93cbca6269fade0f7f31df4c88a7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007be8076f4ea4a4ad08075c2508e481d6c946d12b000000000000000000000000e56b8956fc04d120d351febbb1bcf1f1949aea850000000000000000000000000000000000000000000000000000000000
@null-none
null-none / example.py
Created May 27, 2020 08:42
Code example: Estimating Pi with Fiber
from fiber import Pool
import random
NUM_SAMPLES = int(1e6)
def is_inside(p):
x, y = random.random(), random.random()
return x * x + y * y < 1
def main():
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component language="neutral" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>0409:00000409</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
...
labels = {f.name: f.verbose_name for f in Model._meta.get_fields()}
errors_keys = tuple(form.errors.keys())
for k in errors_keys:
form.errors[labels[k]] = form.errors[k]
del form.errors[k]
messages.error(self.request, form.errors.as_text())
...
@null-none
null-none / ubuntu1804.cfg
Created December 24, 2018 09:26
Minimal Kickstart File for Ubuntu 18.04
#Generated by Kickstart Configurator
#platform=x86
# Fetch content from here
url –url http://nl.archive.ubuntu.com/ubuntu/
#System language
lang en_US.UTF-8
#Language modules to install
@null-none
null-none / centos7.cfg
Last active December 25, 2018 17:55
Minimal Kickstart File for CentOS 7
install
autostep
reboot
text
skipx
lang en_US.UTF-8
keyboard us
@null-none
null-none / F7.java
Created May 23, 2017 07:17
Blank F7 (OkHttp)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"sndr\": \"sndr\",\n\t\"rcpn\": \"rcpn\",\n\t\"from_phone\": \"1234567890\",\n\t\"to_phone\": \"1234567890\",\n\t\"sms_notices\": 1,\n\t\"street_from\": \"street_from\",\n\t\"house_from\": 1,\n\t\"place_from\": \"place_from\",\n\t\"region_from\": \"place_from\",\n\t\"index_from\": 123456,\n\t\"street_to\": \"street_to\",\n\t\"house_to\": 1,\n\t\"place_to\": \"place_to\",\n\t\"region_to\": \"region_to\",\n\t\"index_to\": 123456,\n\t\"weight\": 100\n}");
Request request = new Request.Builder()
.url("http://beta.pbrf.ru/v1/blank/f7")
.post(body)
.addHeader("content-type", "application/json")
.build();
@null-none
null-none / f7.java
Created May 23, 2017 07:16
Blank F7 (Unirest)
HttpResponse<String> response = Unirest.post("http://beta.pbrf.ru/v1/blank/f7")
.header("content-type", "application/json")
.body("{\n\t\"sndr\": \"sndr\",\n\t\"rcpn\": \"rcpn\",\n\t\"from_phone\": \"1234567890\",\n\t\"to_phone\": \"1234567890\",\n\t\"sms_notices\": 1,\n\t\"street_from\": \"street_from\",\n\t\"house_from\": 1,\n\t\"place_from\": \"place_from\",\n\t\"region_from\": \"place_from\",\n\t\"index_from\": 123456,\n\t\"street_to\": \"street_to\",\n\t\"house_to\": 1,\n\t\"place_to\": \"place_to\",\n\t\"region_to\": \"region_to\",\n\t\"index_to\": 123456,\n\t\"weight\": 100\n}")
.asString();
@null-none
null-none / example.js
Last active February 25, 2017 10:35
lat, lng distance
function City(lat, lng, name) {
this.lat = lat; // lat city
this.lng = lng; // lng city
this.name = name; // name city
};
function Car(lat, lng, radius, available, id) {
this.lat = lat; // current lat
this.lng = lng; // current lng
this.radius = radius; // coverage radius