Skip to content

Instantly share code, notes, and snippets.

@nnzo
nnzo / monitor.js
Last active May 24, 2022 06:44
Monitor Geth node progress script
// PASTE the below into your Geth Javascript console (geth attach)
// Every minute it'll report the total days and estimated blocks per second
lastSyncedBlock = 1;
(function percentage() {
ee = eth.syncing.currentBlock - lastSyncedBlock
perSecond = (ee / 60).toFixed(3)
totalSeconds = (eth.syncing.highestBlock - eth.syncing.currentBlock) / perSecond
totalDays = (totalSeconds / 86400).toFixed(4)
console.log('Rate of ' + perSecond + ' blocks per second. ' + 'Estimated ' + totalDays + ' days.')
@nnzo
nnzo / keybase.md
Created March 28, 2022 11:57
keybase.md

Keybase proof

I hereby claim:

  • I am nnzo on github.
  • I am enzogla (https://keybase.io/enzogla) on keybase.
  • I have a public key ASDZ9XcPdNHIyHIgvJeKgdMRTdPFIF2n5AE8osLuNN4rgQo

To claim this, I am signing this object:

@nnzo
nnzo / Keybase.md
Created March 28, 2022 11:55
keybase.md

enzogla

Keybase proof

I hereby claim:

  • I am nnzo on github.
  • I am enzogla (https://keybase.io/enzogla) on keybase.
  • I have a public key ASDZ9XcPdNHIyHIgvJeKgdMRTdPFIF2n5AE8osLuNN4rgQo

To claim this, I am signing this object:

@nnzo
nnzo / index.html
Created September 1, 2021 06:21
Title Text Animation
<section class="container">
<h1>
<span class="title">Lundi</span>
</h1>
</section>
@nnzo
nnzo / swifttimer.swift
Created December 1, 2020 01:01
swift timer
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
print("Timer fired!")
}
@nnzo
nnzo / swift.swift
Created October 21, 2020 20:50
Swipe right to delete SwiftUI List
struct SingleIsland {
let name: String
}
struct ContentView: View {
@State var islands = [
SingleIsland(name: "Wangerooge"),
SingleIsland(name: "Spiekeroog"),
SingleIsland(name: "Langeoog")
@nnzo
nnzo / lightclientpeers.txt
Created September 9, 2020 22:46
Geth light client peers
admin.addPeer("enode://b6058de83ed4d4496b6bc95a8fa14411d18c496212740616744f6ff501700caf5c3068c37d4befc02047bf4e5dcc610197f002e57c20b5bbdee5f2aa27e2c953@18.156.36.188:30303")
admin.addPeer("enode://0fdca3b09a4f0f6f8c0e01512fd5506c511cbeaa3441434c80f087bd117fe79677662649c1c7be4ab714875f125ff621e4bdec897e754f89e04fc85f82bc9391@116.202.170.226:30303")
admin.addPeer("enode://9d45f21eeb37bd5555fac0c4094ae3d4d144d93e2313aeb891bf3054b0dcf6ca817961ed29ea1de00389b5c36dc6bbe9b00443e367b16ed8ba251cea6c242044@94.176.237.140:30303")
@nnzo
nnzo / RailsCheatSheet.txt
Created August 29, 2020 09:03
RailsCheatSheet
RAILS_ENV=production bundle exec rake db:create db:schema:load
@nnzo
nnzo / rubystringclass.rb
Created August 8, 2020 02:20
Ruby String class extension
# Add .numeric?
class String
def numeric?
return true if self =~ /\A\d+\Z/
true if Float(self) rescue false
end
end
require 'net/http'
require 'uri'
require 'json'
class BitcoinRPC
def initialize(service_url)
@uri = URI.parse(service_url)
end
def method_missing(name, *args)