Skip to content

Instantly share code, notes, and snippets.

View kaustavha's full-sized avatar
:octocat:
:electron: :atom: :shipit: 🚀 🌟 🇮🇳 🇺🇸 🇨🇦 Ethereum fanboi

Kaustav Haldar kaustavha

:octocat:
:electron: :atom: :shipit: 🚀 🌟 🇮🇳 🇺🇸 🇨🇦 Ethereum fanboi
View GitHub Profile
@bogatyy
bogatyy / geth_p2p.patch
Created June 30, 2021 22:26
geth_p2p.patch
diff --git a/eth/fetcher/block_fetcher.go b/eth/fetcher/block_fetcher.go
index 3177a877e..6b77b3e58 100644
--- a/eth/fetcher/block_fetcher.go
+++ b/eth/fetcher/block_fetcher.go
@@ -97,6 +97,9 @@ type chainInsertFn func(types.Blocks) (int, error)
// peerDropFn is a callback type for dropping a peer detected as malicious.
type peerDropFn func(id string)
+// peerStatsUpdateFn is a callback type for reporting peer events for stats update.
+type peerStatsUpdateFn func(peer string, event string)
[Unit]
Description=Prysm Beacon Chain
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=ubuntu
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active April 15, 2024 14:39
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@cowboy
cowboy / 1-file.txt
Last active February 13, 2022 22:42
Iterate over all lines in a file, handing extra trailing newlines
foo bar
baz
qux
last line (there may or may not be a trailing newline after this line)
@dshaw
dshaw / nodebook.md
Last active November 17, 2022 14:50
Running Node on a Samsung 303C Chromebook

Running Node on a Samsung 303C Chromebook

Motivation

After @mikeal and @lyle purchased Chromebooks for kids activities at NodeConf 2014, I was very impressed with the device and decided to explore this as a laptop and hacking device for my kids (7 & 8). I'd love to retain the simplicity of the web-focused ChromeOS experience while letting my kids hack on NodeBots and learn how to program.

It seems like the platforms that ChromeOS runs on are quite diverse. The Samsung 303C hit the right balance of being an aesthetically pleasing looking device, having respectable build quality and the amazing $250 price point. The 303C has an ARM processor. Not all Chromebooks do. I'm writing the below step-by-step very specifically for this system.

Resources

@jkreps
jkreps / benchmark-commands.txt
Last active January 21, 2024 11:02
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@pozorvlak
pozorvlak / git-anonymize
Last active February 11, 2023 18:46
Anonymise Git history
#!/bin/sh
# Suppose you want to do blind reviewing of code (eg for job interview
# purposes). Unfortunately, the candidates' names and email addresses are
# stored on every commit! You probably want to assess each candidate's version
# control practices, so just `rm -rf .git` throws away too much information.
# Here's what you can do instead.
# Rewrite all commits to hide the author's name and email
for branch in `ls .git/refs/heads`; do