Skip to content

Instantly share code, notes, and snippets.

View hack3r-0m's full-sized avatar
🎯
Focusing

hack3r-0m

🎯
Focusing
View GitHub Profile
@epogrebnyak
epogrebnyak / digital_asset_types.md
Last active November 22, 2022 02:40
Cryptoeconomics

Value what

Adapted from Blockchain revolution:

  1. cryptocurrencies (BTC)
  2. platforms/smart contracts (ERC-20 + Cosmos, Aion, ICON)
  3. work/utility token (FileCoin, Golem) + via Selkix
  • “securitized” computing resources
@whoisryosuke
whoisryosuke / api-form-submit.js
Created October 3, 2018 17:14
React - Handling forms and submitting POST data to API -- @see: https://reactjs.org/docs/forms.html
class NameForm extends React.Component {
constructor(props) {
super(props);
this.state = { name: '' };
}
handleChange = (event) => {
this.setState({[event.target.name]: event.target.value});
}
@rhlsthrm
rhlsthrm / ReentrancyToken.sol
Created October 9, 2018 17:18
Fake ERC20 token that recreates reentrancy attack
pragma solidity ^0.4.23;
import "./HumanStandardToken.sol";
import "../../LedgerChannel.sol";
contract ReentrancyToken is HumanStandardToken {
LedgerChannel ledgerChannel;
uint256 constant MAX_REENTRIES = 5;
uint256 numReentries = 0;
@npearce
npearce / install-docker.md
Last active May 17, 2024 12:03
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@mathben
mathben / archlinux_installation_ux370u_full_disk_encrypted.sh
Last active January 1, 2022 18:38
BASH - Installation Arch Linux on Asus ZenBook UX370U - Full disk single boot
#!/usr/bin/env bash
# French Guide : https://github.com/FredBezies/arch-tuto-installation
# Install ARCH Linux with UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M status=progress && sync # on linux
@benjiqq
benjiqq / tradingbrokerspec.md
Last active January 30, 2021 07:56
trading broker spec

trading broker spec

proposal version 0.01 this is a rough spec for what a client-side trading infrastructure expects from an interface. There should be a client-side wrapper matching the hosts API. we ignore funding requests here (deposit/withdraw)

Wrapper API

private

// This is universal, works with Infura -- set provider accordingly
const ethers = require('ethers')
//const provider = ethers.getDefaultProvider('rinkeby')
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL)
function hex_to_ascii(str1) {
var hex = str1.toString();
var str = '';
for (var n = 0; n < hex.length; n += 2) {
@ageis
ageis / .bashrc 02-25-2020
Last active May 10, 2024 02:34
@ageis's ~/.bashrc 🖥️ with numerous useful functions, aliases and one-liners. ⚠️ NOTE: many paths in sourced scripts and environment variables are specific to my system, but if you dig in I hope you'll find something you can use!
#!/bin/bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# kevin gallagher (@ageis) <kevingallagher@gmail.com>
# normally I divide this into separate files: .bashrc, .bash_profile, .bash_aliases and .bash_functions (also .bash_logout), but it's all concatenated here.
ulimit -s unlimited
export MYUID=$(id -u)
export USER="$(id -un)"
if [[ "$TILIX_ID" ]] || [[ "$VTE_VERSION" ]]; then
@JeffBelback
JeffBelback / diff-branch.sh
Last active February 4, 2021 09:10
Git Functions
function diff-branch() {
if [ -z $1 ]; then
echo please provide an branch
read WORKBRANCH
else
WORKBRANCH=$1
fi
if [ -z $2 ]; then
STABLEBRANCH='master'
@MosheStauber
MosheStauber / ercxxx_distribution.py
Last active April 14, 2021 14:23
ercxxx_distribution
import json
import os
from collections import defaultdict
from json import JSONDecodeError
from pprint import pprint
from typing import Dict, Union, List
import requests
from bs4 import BeautifulSoup