Skip to content

Instantly share code, notes, and snippets.

View ryanio's full-sized avatar
👨‍🏭

Ryan Ghods ryanio

👨‍🏭
  • Los Angeles
View GitHub Profile
@evertonfraga
evertonfraga / convert-genesis.md
Created November 8, 2019 22:10
genesis balance formats

1. exporting fresh genesis.json for mainnet and ropsten with balances in hex

This PR adds dumpgenesis capability to geth: ethereum/go-ethereum#20191

git clone [email protected]:etclabscore/ethereum.go-ethereum.git etc-geth
cd etc-geth
git checkout etclabscore:feat/cmd-dumpgenesis
make geth

./build/geth dumpgenesis > genesis-mainnet.json
@raineorshine
raineorshine / sendRawTransaction.js
Last active December 3, 2022 18:02
Sends a raw transaction with web3 v1.2.2, ethereumjs-tx v2.1.1, and Infura
const Web3 = require('web3')
const Tx = require('ethereumjs-tx').Transaction
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privateKey = new Buffer('PRIVATE_KEY', 'hex')
@chriseth
chriseth / contract.sol
Created June 4, 2015 13:17
Solidity decimal conversion
contract c {
uint a;
function charAt(bytes32 b, uint char) returns (bytes1) {
return bytes1(uint8(uint(b) / (2**((31 - char) * 8))));
}
function parseDecimal(bytes32 byteString) returns (uint r) {
uint n = uint(byteString);
for (uint b = 0; b < 32; b ++)
{
var c = uint8(charAt(byteString, b));
@visnup
visnup / SlideAnimatedTransitioning.h
Last active November 9, 2024 08:57
iOS 7 screen edge gesture swipe from right to left (similar to edge swiping from left to right) on UINavigationController. *only* the edge swipe uses the custom transition; everything else uses default behaviors.
//
// SlideAnimatedTransitioning.h
// SwipeLeft
//
// Created by Visnu on 4/14/14.
// Copyright (c) 2014 Visnu Pitiyanuvath. All rights reserved.
//
#import <Foundation/Foundation.h>
@thoop
thoop / nginx.conf
Last active November 12, 2024 19:08
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;