Skip to content

Instantly share code, notes, and snippets.

@subintp
subintp / encryptor.py
Created March 23, 2016 05:54
RSA/ECB with PKCS1 padding in Python
import rsa
import base64
# modulus in integer
MODULUS = 123456789996582395910301286053968077124788323801012630967456380836472396333396466272319708473453610663848909708214595391668878270127153659315097128748348977528953482874935452127643776505027944666257946919553474879512809890824078158244248097149714260265207481163611166304138228724039676901039297181889888815151
# exponent in integer
EXPONENT = 65537
PUBLIC_KEY = rsa.PublicKey(MODULUS, EXPONENT)
# Bootcamp
The following guide will help you acquire the required skills. Also we suggest you go through the books and videos linked throughout the guide.
### Week 1
We measure our productivity all the time. This is the only way to improve our skills. Measure and push ourself to do slightly better the next time. A huge part of productivity is managing time. The following video and books will give some tips and strategies which you can start implementing right now!
#### Your Brain @ Work
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially
@subintp
subintp / latency.txt
Created February 7, 2020 07:45 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@subintp
subintp / readme.md
Created February 20, 2020 07:47 — forked from maxivak/readme.md
Integrating Gem/Engine and Main Rails App
@subintp
subintp / gist:66b0455a2b1019f031a6857b71e4e138
Last active March 19, 2020 13:28
Cassandra data modeling principles
Design Principles
1. Sacrifice space for time
2. Single partition per query
Cassandra Data Modelling Process
1. Conceptual Modelling
Identify Entities, attributes and their relationships
Eg: User one -> many Campaigns (relationship)
**********Redis***************
Single threaded
No need to worry about locks
Cannot explore multiple cores.Need to run multiple instance in multiple coress.
Both master and slave in the same machine. Master goes down there is high change for data loss
Data structures
Rich data structures. Lot of operation on data structures is supported natively.
Nested data structures is not supported.
#!/bin/sh
mkdir -p src/{main,test}/{java,resources,scala}
mkdir lib project target
# create an initial build.sbt file
echo 'name := "MyProject"
version := "1.0-SNAPSHOT"
scalaVersion := "2.13.1"' > build.sbt
# create alias in bashrc
import com.twitter.algebird.{
HLL,
HyperLogLog,
HyperLogLogAggregator,
HyperLogLogMonoid
}
object HLL extends App {
val hllMonoid = new HyperLogLogMonoid(bits = 4)
@subintp
subintp / gist:c8b743bef37c96f5d7cf92cff941a773
Created November 13, 2023 16:17
g2_review_scrapper.rb
def scrape_reviews(review_url, pages)
for i in 1..14 do
results = scraper(review_url+"&page="+i.to_s)
append_to_file(results)
end
end
def scraper(url)
results = []
browser = Watir::Browser.new :chrome