Skip to content

Instantly share code, notes, and snippets.

@xxuejie
xxuejie / keybase.md
Created July 26, 2020 01:18
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

$ cat << EOF > market_data.json
{
"coin_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"builder_pubkey_hash": "0x276f2fa3565a10c76164a5e92d4a0b699889ef48",
"lease_period": "0x64",
"overdue_period": "0x64",
"amount_per_period": "0x91494c600",
"lease_amounts": "0x12309ce54000"
}
EOF
@xxuejie
xxuejie / build-gcc.md
Last active October 4, 2019 20:25 — forked from vlad-ivanov-name/build-gcc.md
build cross riscv32imac gcc with newlib

Set environment variables

export TARGET=riscv32-unknown-elf
export PREFIX=/work/public/$TARGET
export PATH=$PATH:$PREFIX/bin

Build binutils

@xxuejie
xxuejie / Dockerfile
Created August 17, 2017 03:25
Dockerfile for reproducing crystal build failure
FROM ubuntu:xenial
RUN apt-get update
RUN apt-get install \
libbsd-dev \
libedit-dev \
libevent-core-2.0-5 \
libevent-dev \
libevent-extra-2.0-5 \
libevent-openssl-2.0-5 \
@xxuejie
xxuejie / how-to-connect-an-iOS-device-to-your-computer-using-SOCKS.md
Last active February 10, 2017 20:32 — forked from austinhappel/how-to-connect-an-iOS-device-to-your-computer-using-SOCKS.md
How to connect an iOS device to your computer via a SOCKS proxy. Say you're running a virtual machine on your work computer. Say this machine, for whatever reason, can only connect to the internet over NAT - as in, it does not get it's own IP address. Say this VM is running a webserver, and you need a device outside of your computer to connect t…

How to connect an iOS device to your computer via a SOCKS proxy

Say you're running a virtual machine on your work computer. Say this machine, for whatever reason, can only connect to the internet over NAT - as in, it does not get it's own IP address. Say this VM is running a webserver, and you need a device outside of your computer to connect to it.

If only there was a way to get your work computer to 'share' it's network, so that you could get at that VM… Here's how you do it!

For all instructions, I assume your work computer is a mac

  1. Get your computer's IP address:
$ # testing syro
$ wrk -t12 -c400 -d30s http://127.0.0.1:9292/foo/bar
Running 30s test @ http://127.0.0.1:9292/foo/bar
12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 186.63ms 75.95ms 712.69ms 71.36%
Req/Sec 58.40 66.78 280.00 79.20%
16025 requests in 30.09s, 2.81MB read
Socket errors: connect 0, read 310, write 0, timeout 0
Requests/sec: 532.63
@xxuejie
xxuejie / Rakefile
Created February 22, 2015 09:10
Webruby project rakefile including SDL2
require 'webruby'
# This file sets up the build environment for a webruby project.
Webruby::App.setup do |conf|
# Entrypoint file name
conf.entrypoint = 'app/app.rb'
# By default, the build output directory is "build/"
conf.build_dir = 'build'
@xxuejie
xxuejie / build.log
Last active August 29, 2015 14:14
mruby build log
(in /Users/rafael/develop/opensource/mruby)
mkdir -p /Users/rafael/develop/opensource/mruby/bin
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/array.o" -c "/Users/rafael/develop/opensource/mruby/src/array.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/backtrace.o" -c "/Users/rafael/develop/opensource/mruby/src/backtrace.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/class.o" -c "/Users/rafael/develop/opensource/mruby/src/class.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-functi
@xxuejie
xxuejie / .vimrc
Created April 12, 2014 04:24
Minimal vimrc
set nocompatible
syntax on
filetype plugin indent on
set background=dark
colorscheme solarized
set ffs=mac,unix,dos
set encoding=utf-8
@xxuejie
xxuejie / status.md
Created March 3, 2014 13:09
Regarding the current status of webruby

We now have reached a corner regarding the development of webruby.Emscripten is now switching to a LLVM-based backend, which eventually will replace the old JS-based backend. However, a bug in clang prevents us to use the new le32-unknown-nacl triple in LLVM/emscripten, it also prevents us from using the new LLVM-based backend of emscripten.

A fix has been developed for LLVM to solve this problem, but as of today, it's neither in the PNaCl fork of clang, nor emscripten-fastcomp-clang. So this prevents us from switching to the latest version of emscripten.

In a meantime, an attempt to fix this problem at mruby side was also rejected, since this would complicate mruby a lot for a small corner case.

We could maintain