Skip to content

Instantly share code, notes, and snippets.

View witoldsz's full-sized avatar

Witold Szczerba witoldsz

View GitHub Profile

Keybase proof

I hereby claim:

  • I am witoldsz on github.
  • I am witoldsz (https://keybase.io/witoldsz) on keybase.
  • I have a public key ASCdoIhvg1iSXn47BeFYxYPtpLETlkio4pXQGSTGCwXaGgo

To claim this, I am signing this object:

@witoldsz
witoldsz / sempool.js
Created December 28, 2018 18:20
Semux Pool calc (concept)
const DELEGATE_ADDR = '0x…'
const TXS_URL = `https://semux.online/v2.1.0/account/transactions?address=${DELEGATE_ADDR}&from=${0}&to=99999`
const BURNED_SEM_OWNER = shortHash('0x…')
const BURNED_SEM_PAID_DATE = new Date('2018-10-15T00:00:00Z')
const IGNORE_ADDR = '0x…'
const ALIASES = {
'xyz1': '🔜',
@witoldsz
witoldsz / app.js
Created December 7, 2018 00:00
My first contact with Cycle.JS
const { h, makeDOMDriver } = require('@cycle/dom')
const { run } = require('@cycle/run')
const { readDb, writeDb, filterDb, findById } = require('./db')
const { banner } = require('./view-extra')
const sampleCombine = require('xstream/extra/sampleCombine').default
const xs = require('xstream').default
const R = require('ramda')
function intent(domSource) {
return {
@witoldsz
witoldsz / main.js
Last active October 11, 2018 20:47
jedna8 created by witoldsz - https://repl.it/@witoldsz/jedna8
const DELEGATE_ADDR = '0x6f673a46f3529a8e0933145dde78d91004a5d944'
const TXS_URL = `https://semux.online/v2.1.0/account/transactions?address=${DELEGATE_ADDR}&from=${0}&to=99999`
const BURNED_SEM_OWNER = shortHash('0x0d2a67855fae0a04509198d7591f9c09450053cf')
const BURNED_SEM_PAID_DATE = new Date('2018-10-10T00:00:00Z')
async function main() {
const txs = await fetchTxs()
const initialState = {
@witoldsz
witoldsz / semvote.sh
Last active July 6, 2019 18:04
Semux: votes from SRC to DST. The amount is rounded to 1SEM and at least 2xFEE is left in wallet.
#!/bin/sh
USER=user
PASS=123456
SRC=0x6c9abb991956fe34e7e55ba024e3c6cd4a40eac4
DST=0x6c9abb991956fe34e7e55ba024e3c6cd4a40eac4
URL=http://${USER}:${PASS}@localhost:6171/v2.3.0
ONE_SEM=1000000000
FEE=5000000
const example_key = {
pub: "-----BEGIN PUBLIC KEY-----\n" +
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9kDZw/3AtZ2FSY1byp9A\n" +
"0kkJ1DJdX2iKDmE5YAaloWA92FNxQ9txd5ircSyjciv6RJ+CYF1k9G/0p6B2oV2i\n" +
"hSXHbiH5Bby7K6KSogD0toevhrLJovMegLrnrGUzzK1fBsYwjTFlsQPji6Nhbx5l\n" +
"woSbA4Ddz7VlLKUnnDA2gG3+FNSFSPCiY7e1+D/SIzBKynv2xp6Q2a1d1lT2uYpy\n" +
"NykYHH6VYVle544mL48RUR3JP9n0tgq27GQeotCIgMFia6Us811WVXz1/145u4d2\n" +
"GGtN5NRWxs5OC4NyKF28nkfj3ZB0/F2CWCv02Aogeziw/9eX9FoUlyDoD2/FUeVD\n" +
"HQIDAQAB\n" +
"-----END PUBLIC KEY-----\n",
@witoldsz
witoldsz / bashrc
Created October 17, 2017 21:05
git setup in bash
[…]
source ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE="1"
export PS1="\[\033[40m\]\[\033[33m\][ \u@\H:\[\033[32m\]\w\$(__git_ps1 \" \[\033[35m\]{\[\033[36m\]%s\[\033[35m\]}\")\[\033[33m\] ]$\[\033[0m\] "
@witoldsz
witoldsz / README.md
Last active November 13, 2017 16:29
Wake up using ONLY power button

The script scans /proc/acpi/wakeup for all enabled entries, excluding power button and some custom hardware (like sleep buttons) and disables that entries. Especially useful if your computer wakes up on mouse movement or keyboard.

Prerequisites

  • ghc
  • cabal
  • text Haskell library
package e2e.util;
import java.util.Date;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Consequence;
import net.serenitybdd.screenplay.EventualConsequence;
import net.serenitybdd.screenplay.Performable;
/**
*
class FastScanner {
private final int radix = 10;
private int pos;
private String line;
void init(String line) {
this.line = line;
pos = 0;
}