Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacques Wagener jacqueswww

View GitHub Profile
@jacqueswww
jacqueswww / README.md
Created Aug 11, 2020 — forked from arikfr/README.md
Setting up HTTPS with LetsEncrypt for Redash Docker Deployment
View README.md
  1. Make sure the domain you picked points at the IP of your Redash server.
  2. Switch to the root user (sudo su).
  3. Create a folder named nginx in /opt/redash.
  4. Create in the nginx folder two additional folders: certs and certs-data.
  5. Create the file /opt/redash/nginx/nginx.conf and place the following in it: (replace example.redashapp.com with your domain name)
    upstream redash {
        server redash:5000;
    }
    
@jacqueswww
jacqueswww / priority_stake.v.py
Last active Nov 27, 2019
Stake Based Priority Queuing
View priority_stake.v.py
from vyper.interfaces import ERC20
implements: ERC20
MINIMUM_STAKE: constant(uint256(wei)) = 1 * 10 ** 17
NONREFUNDABLE_DEPOSIT: constant(uint256) = 5 * 10 ** 16
Transfer: event({_from: indexed(address), _to: indexed(address), _value: uint256})
Approval: event({_owner: indexed(address), _spender: indexed(address), _value: uint256})
@jacqueswww
jacqueswww / run_geth.sh
Created Oct 2, 2019
Final ewasm testnet run_geth
View run_geth.sh
#!/bin/bash
set -ex
LIB_HERA_PATH="./hera/build/src/libhera.so"
TMP_PATH="./ewasm-node/4201/"
if [[ ! -d $TMP_PATH ]]; then
echo "Running init"
./build/bin/geth --datadir $TMP_PATH init ewasm-testnet-geth-config.json
fi
View king_of_the_hill_expanded.nim
Final Contract Code:
proc copy_into_ba(to_ba: var auto; offset: int; from_ba: auto) =
for i, x in from_ba:
if offset + i > sizeof(to_ba) - 1:
break
to_ba[offset + i] = x
func to_bytes32(a: uint128): bytes32 =
var tmp: bytes32
View ewasm-testnet-geth-config.json
{
"config": {
"chainId": 66,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"ewasmBlock": 0,
View run_geth.sh
#!/bin/bash
LIB_HERA_PATH="./hera/build/src/libhera.so"
TMP_PATH="./ewasm-node/4201/"
if [[ ! -d $TMP_PATH ]]; then
./build/bin/geth --datadir $TMP_PATH init ewasm-testnet-geth-config.json
fi
./build/bin/geth --vm.ewasm="$LIB_HERA_PATH,metering=true,fallback=true" \
@jacqueswww
jacqueswww / Dockerfile
Last active Aug 23, 2019
nimplay Dockerfile
View Dockerfile
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y software-properties-common wget curl gcc && \
wget https://nim-lang.org/download/nim-0.20.2-linux_x64.tar.xz && \
tar xf nim-0.20.2-linux_x64.tar.xz && \
cd nim-0.20.2 && \
./install.sh /usr/bin && \
cd .. && \
rm -rf nim-0.20.2 && \
View king_of_the_hil.lll
[seq,
[return,
0,
[lll,
[seq,
[mstore, 28, [calldataload, 0]],
[mstore, 32, 1461501637330902918203684832716283019655932542976],
[mstore, 64, 170141183460469231731687303715884105727],
[mstore, 96, -170141183460469231731687303715884105728],
[mstore, 128, 1701411834604692317316873037158841057270000000000],
@jacqueswww
jacqueswww / django_cherry.py
Created Jun 11, 2019
Quick Cherrpy Hosting of a Django App
View django_cherry.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import webbrowser
from threading import Timer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "<app_name>.settings")
import cherrypy
View hello_deploy.wat
(module
(type (;0;) (func (param i32 i32)))
(type (;1;) (func))
(import "ethereum" "finish" (func (;0;) (type 0)))
(func (;1;) (type 1)
i32.const 0
i32.const 661
call 0)
(memory (;0;) 100)
(export "memory" (memory 0))
You can’t perform that action at this time.