Skip to content

Instantly share code, notes, and snippets.


Loredana Cirstea loredanacirstea

View GitHub Profile
GNSPS / ProxyFactory.sol
Last active October 9, 2021 08:47
Improved `delegatecall` proxy contract factory (Solidity) [v0.0.5]
View ProxyFactory.sol
* Shoutouts:
* Bytecode origin
* Modified version of Vitalik's
* Credits to Jorge Izquierdo (@izqui) for coming up with this design here:
* Credits to Stefan George (@Georgi87) for inspiration for many of the improvements from Gnosis Safe:
* This version has many improvements over the original @izqui's library like using REVERT instead of THROWing on failed calls.
* It also implements the awesome design pattern for initializing code as seen in Gnosis Safe Factory:

Answers to Deep Questions about Solidity

The following list of questions was taken from

An updated summary on the different ways one could have two contracts interact (DELEGATECALL, STATICCALL, libraries, all that stuff) with clear pros/cons for each (gas cost, whether it requires EVM assembly directives, etc)

Question by /u/drcode

I won't talk about low-level opcodes here because of the brevity of the answer. In general, there are four ways functions can be called in Solidity:

konradkonrad /
Last active October 13, 2017 08:29
geth pending tx to raw tx hex
#!/usr/bin/env python
import sys
import yaml
from ethereum.transactions import Transaction
from ethereum.utils import encode_hex, decode_hex
import rlp
def geth_tx_to_raw(tx):
for field in ['blockHash', 'blockNumber', 'hash', 'transactionIndex', 'from']:
View WatchDutchAuction.js
var auction_abi = [{"constant":true,"inputs":[],"name":"num_tokens_auctioned","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"final_price","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"price_exponent","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"end_time","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"bid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"token_multiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"price_start","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutabi
loretoparisi /
Last active June 12, 2017 12:36
FairSeq Torch Installation macOS
git clone && cd torchnet
~/torch/install/bin/luarocks install rocks/torchnet-scm-1.rockspec
git clone && cd torch-rnnlib/
~/torch/install/bin/luarocks make rocks/rnnlib-0.1-1.rockspec .
~/torch/install/bin/luarocks build build
~/torch/install/bin/luarocks build
ekristen /
Last active February 5, 2023 18:26
Bash Script for Nagios to Check Status of Docker Container
# Author: Erik Kristensen
# Email:
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./ _container_id_
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
mkaminsky11 / download.js
Last active October 20, 2022 12:17
How to manipulate Google Drive files
View download.js
Download a file
function downloadFile(fileId) {
var request ={
'fileId': fileId
request.execute(function(resp) {
canton7 /
Created January 6, 2012 13:45
Workflows for long-running feature branches

Workflows for long-running feature branches

These examples were created during a discussion with j416 on #github about how best to manage long-running feature branches.

The scenario is this: You have a long-running feature branch, based off master. The feature branch and master both touch the same parts of the same files, so you know that there will be conflicts when you finally merge the feature branch in. What can you do to minimise the conflicts?