Skip to content

Instantly share code, notes, and snippets.

View danhper's full-sized avatar

Daniel Perez danhper

View GitHub Profile
@danhper
danhper / contracts.md
Created March 20, 2022 15:59
Backd mainnet contracts
@danhper
danhper / create_contract.py
Created April 10, 2020 17:13
Creates a contract from bytecode on Ethereum
"""Creates a contract from the raw bytecode
Requires web3py to be installed
```
pip install web3
```
usage: python create_contract.py [-a ACCOUNT] [-v VALUE] [--ipc-path IPC_PATH] contract
"""
id type metaType count value
0 SimpleName Other 97312691
1 NameExpr Expr 68713314
2 MethodCallExpr Expr 42016872
3 ClassOrInterfaceType Type 41234004
4 ExpressionStmt Stmt 31012516
5 Name Other 23675783
6 BlockStmt Stmt 16994828
7 VariableDeclarator Other 14001828
8 VariableDeclarationExpr Expr 10163270
@danhper
danhper / pacman-packages.txt
Last active October 12, 2018 13:25
packages to install with pacman on new installations
vim
networkmanager
xorg-server
xorg
xmonad
xmonad-contrib
xmobar
intel-ucode
pkgfile
git
@danhper
danhper / keybase.md
Last active September 24, 2018 19:12

Keybase proof

I hereby claim:

  • I am danhper on github.
  • I am tuvistavie (https://keybase.io/tuvistavie) on keybase.
  • I have a public key ASCusmLiJUiU4smze78NA5NRBc5LqbkSFPpLHGh_miQC8Ao
@danhper
danhper / mozc.patch
Created September 1, 2018 05:54
sha1: 0fcab969477022e45cd9067b18a48835373e2687
diff -ura mozc.orig/src/prediction/zero_query_dict.h mozc/src/prediction/zero_query_dict.h
--- mozc.orig/src/prediction/zero_query_dict.h 2018-05-27 12:14:39.000000000 +0200
+++ mozc/src/prediction/zero_query_dict.h 2018-05-27 12:16:53.158743824 +0200
@@ -132,6 +132,17 @@
return tmp;
}
+ iterator &operator--() {
+ ptr_ -= kTokenByteSize;
+ return *this;
@danhper
danhper / parmap_sample.ml
Created April 11, 2018 08:42
Sample usage of OCaml parmap library
(**************************************************************************)
(* Sample usage of OCaml parmap library *)
(* https://github.com/rdicosmo/parmap *)
(* *)
(* Computes pi using a simple approximation *)
(* \frac{\pi}{4} = \sum_{n=0}^{\infty} \frac{(-1)^n}{2n + 1} *)
(* *)
(* Compile with the following command: *)
(* ocamlfind ocamlopt -linkpkg -package parmap parmap_sample.ml *)
(**************************************************************************)
{{redirect|UK}}
{{基礎情報 国
|略名 = イギリス
|日本語国名 = グレートブリテン及び北アイルランド連合王国
|公式国名 = {{lang|en|United Kingdom of Great Britain and Northern Ireland}}<ref>英語以外での正式国名:<br/>
*{{lang|gd|An Rìoghachd Aonaichte na Breatainn Mhòr agus Eirinn mu Thuath}}([[スコットランド・ゲール語]])<br/>
*{{lang|cy|Teyrnas Gyfunol Prydain Fawr a Gogledd Iwerddon}}([[ウェールズ語]])<br/>
*{{lang|ga|Ríocht Aontaithe na Breataine Móire agus Tuaisceart na hÉireann}}([[アイルランド語]])<br/>
*{{lang|kw|An Rywvaneth Unys a Vreten Veur hag Iwerdhon Glédh}}([[コーンウォール語]])<br/>
*{{lang|sco|Unitit Kinrick o Great Breetain an Northren Ireland}}([[スコットランド語]])<br/>
#include <complex>
#include <iostream>
#include <boost/typeof/std/complex.hpp>
#include <boost/units/systems/si/energy.hpp>
#include <boost/units/systems/si/force.hpp>
#include <boost/units/systems/si/length.hpp>
#include <boost/units/systems/si/electric_potential.hpp>
#include <boost/units/systems/si/current.hpp>
@danhper
danhper / fabfile.py
Created July 12, 2017 10:26
Sample fabfile.py
from fabric.api import run, env, cd
env.hosts = ['host1', 'host2']
def deploy():
with cd("~/my-project"):
run("git fetch")
run("git checkout --force origin/master")
run("make setup")
run("make restart_app")