Skip to content

Instantly share code, notes, and snippets.

View paulperegud's full-sized avatar

Paul Peregud paulperegud

  • Warsaw
View GitHub Profile

Keybase proof

I hereby claim:

  • I am paulperegud on github.
  • I am pepesha (https://keybase.io/pepesha) on keybase.
  • I have a public key whose fingerprint is 672F CEFB 307E D0FD BA6F B2CF 31D9 8822 92BC B42A

To claim this, I am signing this object:

@paulperegud
paulperegud / exercises.go
Last active August 28, 2015 17:12
tour.golang exercise solutions
/******************************************************************************************************/
/* Exercise: Stringers */
package main
import "fmt"
type IPAddr [4]byte
// TODO: Add a "String() string" method to IPAddr.
@paulperegud
paulperegud / .spacemacs
Created October 12, 2016 15:47
.spacemacs config which causes solidity-mode to install but not to load
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
[{
caps: ["eth/62", "eth/63"],
id: "063fb85dfcbeb235998e97da5423c2693b4707bfa67aadb48f2d572eed74627dc4827e8b5910b9f8c74bf8a006aa63acb4bbbd9cf386824fbfd4e074415a0a53",
name: "Geth/v1.4.18-stable-c72f5459/windows/go1.7",
network: {
localAddress: "10.30.10.189:44394",
remoteAddress: "94.55.134.181:30303"
},
protocols: {
eth: {
#!/usr/sbin/nft -f
# to list rules: nft list table t
# to remove rules: nft flush table t
define nodes = { 200.69.141.134, 52.40.149.71, 45.32.83.15 }
add table t
add chain ip t input { type filter hook input priority 0; policy accept; }
add rule t input ip daddr $nodes drop
@paulperegud
paulperegud / geth.full.log
Created March 6, 2017 11:59
geth: --light switch changing behavior of filters
Geth was started using `geth --testnet --rpc`
In eth_newFilter call "latest" is specified and logs contain non-null blockHash, as per documentation.
pawel@ppsh:~$ mv .ethereum/testnet/geth.ipc .ethereum/testnet/geth.ipc.original
pawel@ppsh:~$ socat -t1000 -x -v UNIX-LISTEN:/home/pawel/.ethereum/testnet/geth.ipc,mode=777,reuseaddr,fork UNIX-CONNECT:/home/pawel/.ethereum/testnet/geth.ipc.original
> 2017/03/06 12:37:42.323238 length=283 from=0 to=282
7b 22 6a 73 6f 6e 72 70 63 22 3a 20 22 32 2e 30 {"jsonrpc": "2.0
22 2c 20 22 70 61 72 61 6d 73 22 3a 20 5b 7b 22 ", "params": [{"
74 6f 70 69 63 73 22 3a 20 5b 22 30 78 64 64 66 topics": ["0xddf
@paulperegud
paulperegud / solc-0.4.10.bug
Created April 21, 2017 11:52
solc-0.4.10.bug
$ ls
LibContract.sol MainContract.sol
$ cat LibContract.sol
pragma solidity ^0.4.10;
contract LibContract {
uint256 public constant varA = 2;
uint256 public constant varB = varA;
function LibContract() {
- command-execute 46,470,145 76%
- call-interactively 46,470,145 76%
- byte-code 42,079,159 68%
- helm-M-x-read-extended-command 42,079,159 68%
- helm-comp-read 42,077,047 68%
- helm 41,812,669 68%
- apply 41,811,645 68%
- helm 41,811,645 68%
- apply 41,811,645 68%
- helm-internal 41,811,645 68%
@paulperegud
paulperegud / ballot.sol
Created May 8, 2018 12:25
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.23+commit.124ca40d.js&optimize=false&gist=
pragma solidity ^0.4.18;
interface IRegistry {
event ProxyCreated(address proxy);
/**
* @dev This event will be emitted every time a new implementation is registered
* @param version representing the version name of the registered implementation
* @param implementation representing the address of the registered implementation
*/
@paulperegud
paulperegud / config.exs
Created October 22, 2018 12:54
config.exs syntax problem
use Mix.Config
config :logger,
handle_otp_reports: false,
handle_sasl_reports: false
config :logger, :console,
level: :info,
format: "$date $time [$level] $metadata⋅$message⋅\n",
metadata: [:module, :function, :request_id]