Skip to content

Instantly share code, notes, and snippets.

View justlstn's full-sized avatar
👨‍💻
Write some code. Sometimes it works

Viacheslav Matsenko justlstn

👨‍💻
Write some code. Sometimes it works
  • alao AG
  • Kharkiv, Ukraine
View GitHub Profile
@justlstn
justlstn / aptos-oidb-zk-ceremony_attestation.log
Created February 22, 2024 17:11
Attestation for aptos-oidb-zk-ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm justlstn-10776006 and I have contributed to the aptos-oidb-zk-ceremony.
The following are my contribution signatures:
Circuit # 1 (main)
Contributor # 20
Contribution Hash: 6c3ab584 a1f6d8f8 b54b8706 60a82691
1bf1f6d6 cb58815c 1362e23b cbd208ea
9f0f11e7 02f61791 90db3bc9 2d4a8ea2
81eebd19 c30e0eb2 1a9930bf 42c53cfc
@justlstn
justlstn / dashboard.sh
Created September 7, 2022 21:12
[AIT] Check Aptos successful/failed proposals & rewards for each epoch
#/bin/sh
MAIN_ADDR="<main_account_addr>"
DATA_SOURCE="https://aptos-analytics-data-it3.s3.us-west-2.amazonaws.com/validator_epoch_history.json"
echo "Awaiting response... \n"
curl -s $DATA_SOURCE \
| jq -c "map ( select ( .validator_addr == \"$MAIN_ADDR\" ) )" \
| jq -r '"EPOCH\tFAILED\tSUCCESS\tEARNED_REWARDS\tMAX_REWARDS", "-----\t------\t-------\t--------------\t-----------", (.[] | "\(.epoch)\t\(.failed_proposal_count)\t\(.successful_proposal_count)\t\(.rewards_earned)\t\(.max_potential_reward)")'
@justlstn
justlstn / class_decorator.ts
Created May 9, 2020 22:22 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@justlstn
justlstn / parallax-mouse-moving.js
Last active May 14, 2019 08:15
Returns an object with coors that you can use for CSS transition { top, left }
export const getOffset = (e, offset = 3, isCentered = true) => {
const pageX = e.pageX
const pageY = e.pageY
const scrollTop = window.pageYOffset // To remove a {scrollTop} from the {pageY}
const winWidth = window.innerWidth
const winHeight = window.innerHeight
const centerTop = winHeight / 2
const centerLeft = winWidth / 2
const onePercentWidth = centerLeft / offset
const onePercentHeight = centerTop / offset
@justlstn
justlstn / install-docker.sh
Created February 18, 2019 23:57 — forked from dweldon/install-docker.sh
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@justlstn
justlstn / script.js
Created September 27, 2018 11:05
Receiving video via webcam
let getUserMedia;
let browserUserMedia = navigator.webkitGetUserMedia
|| navigator.mozGetUserMedia
|| navigator.getUserMedia;
if (!browserUserMedia) throw 'Your browser doesn\'t support WebRTC';
getUserMedia = browserUserMedia.bind(navigator);
let successCb = stream => {
@justlstn
justlstn / simple-pagination.js
Created August 26, 2018 18:00 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@justlstn
justlstn / add-files-to-custom-fields.php
Created August 24, 2018 10:18
Add multiple files to acf repeater field
$files = $_FILES[ 'attachments' ];
$attachments = [];
foreach ( $files['name'] as $key => $value ) {
if ( $files[ 'name' ][ $key ] ) {
$file = array(
'name' => $files[ 'name' ][ $key ],
'type' => $files[ 'type' ][ $key ],
'tmp_name' => $files[ 'tmp_name' ][ $key ],
'error' => $files[ 'error' ][ $key ],
@justlstn
justlstn / fileUpload.vue
Created August 23, 2018 23:09 — forked from raisiqueira/fileUpload.vue
Simple file upload with Vue and Axios
<style>
input[type="file"]{
position: absolute;
top: -500px;
}
div.file-listing{
width: 200px;
}
@justlstn
justlstn / _animations.scss
Last active July 9, 2018 15:50
Block UI & Preloader with spin animations
@keyframes block-ui-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}