Skip to content

Instantly share code, notes, and snippets.

View mradkov's full-sized avatar

mradkov

View GitHub Profile
export function slideInFromLeft(delay: number) {
return {
hidden: { x: -100, opacity: 0 },
visible: {
x: 0,
opacity: 1,
transition: {
delay: delay,
duration: 0.5,
},
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
readonly URL='https://github.com/aeternity/superhero-wallet'
git fetch --tags
@mradkov
mradkov / wineTax.js
Created December 1, 2020 09:47 — forked from johntran/wineTax.js
ES7 async/await with SOAP requests in NodeJS
import soap from 'soap';
import moment from 'moment';
const taxServiceUrl = 'http://hehexd.com/services/1.2/taxservice.asmx?WSDL'
export function generateJsonForTaxRate(json) {
const EffectiveDate = moment().toISOString();
const {
city: City,
state: State,
addressLineOne: Street1,
@mradkov
mradkov / example.nginx
Created August 12, 2020 15:01 — forked from gsanders5/example.nginx
Automatic nginx virtual subdomains with sub-folders or sub-directories
# Automatic nginx virtual subdomains with sub-folders or sub-directories
#
# Since the original source where I found this code is now offline, I have decided to mirror it here.
# All credit goes to: http://web.archive.org/web/20150307193208/http://www.messaliberty.com/2010/10/automatic-nginx-virtual-subdomains-with-sub-folders-or-sub-directories
#
# Description: In my web root directory I wanted create a folder called photos, and another called
# music using a sftp program. Without manually going back to the config file or to the shell I like to
# be able to access them at photos.nginxdomain.com and music.nginxdomain.com. That is what this config does.
# Redirect visitors from http://nginxdomain.com/ to http://www.nginxdomain.com/
@mradkov
mradkov / Rent.sol
Created January 21, 2020 16:00
demo rent
pragma solidity >=0.4.22 <0.6.0;
contract Rent {
address public landlord;
address public renter;
uint256 public price = 1 ether;
uint256 public lastPaid;
uint256 public nextPayment;
@mradkov
mradkov / Demo_supply
Created December 12, 2019 18:02
Not tested
@compiler >= 4
include "Option.aes"
payable contract MyContract =
record state =
{ bottles : map(hash, address)
, supplier : address }
@compiler >= 4
contract OracleCheck =
record state = { queries : map(int, oracle_query(string, string))
, oracle_service: oracle(string, string) }
entrypoint init() : state =
{ queries = {},
oracle_service = ok_264qKMuN5A3SQfn5xHvXpXxwWv3fKJWXkuvWkzays6y61afvhi : oracle(string, string) }
pragma solidity >=0.4.22 <0.6.0;
contract TodoList {
uint256 id = 0;
mapping(uint256 => Todo) public todos;
struct Todo {
string description;
bool status;
@mradkov
mradkov / solidity-contract-address.sol
Created September 4, 2019 09:42
Contract address predictor from `origin` and `nonce`
pragma solidity ^0.4.25;
contract Example {
constructor() public {}
function addressFrom(address _origin, uint _nonce) public pure returns (address) {
bytes memory data;
if(_nonce == 0x00) data = abi.encodePacked(byte(0xd6), byte(0x94), _origin, byte(0x80));
else if(_nonce <= 0x7f) data = abi.encodePacked(byte(0xd6), byte(0x94), _origin, byte(_nonce));
import { select } from 'redux-saga/effects';
export default function* call(fn, args, value) {
const contract = yield select(s => s.contract.contract);
const options = {
ttl: 55,
fee: 1e16,
gas: 1e6,
gasPrice: 1e9,