Skip to content

Instantly share code, notes, and snippets.

@vs4vijay
vs4vijay / latency.txt
Created November 17, 2016 09:27 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
### Keybase proof
I hereby claim:
* I am vs4vijay on github.
* I am vs4vijay (https://keybase.io/vs4vijay) on keybase.
* I have a public key ASBV_u_0IvkkCaNqzD09urK2ioS-zpwABimqh0UmjFurpgo
To claim this, I am signing this object:
@vs4vijay
vs4vijay / viz-metadata.json
Created April 19, 2021 19:16
Viz Cardano Pool
{
"name": "Viz Pool",
"description": "A Cardano Pool on Testnet",
"ticker": "VIZ",
"homepage": "https://github.com/vs4vijay"
}
@vs4vijay
vs4vijay / sms_rules.json
Created April 18, 2017 17:00
Jio SMS Rules JSON
{
"blacklist_regex": "(?i).*[^a-z](password|otp|verification|activation|passcode)[^a-z].*",
"min_app_version": "131",
"rules": [
{
"name": "Airtel",
"telco": true,
"patterns": [
{
"regex": "(?i)Bill.*\\sfor\\sRs.\\s?([\\d,\\,]*(?:.\\d{2})?).*mobile\\s?(\\d{10})?.*Due\\sDate:\\s?([\\d,\\-,A-Z]*)",
@vs4vijay
vs4vijay / 55-bytes-of-css.md
Created October 3, 2022 12:10 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@vs4vijay
vs4vijay / Docker-Alternatives
Last active November 10, 2022 05:04
Windows Docker Alternatives
# OPTION-I: Using Containerd with nerdctl on WSL
- Start WSL2
- Install `containerd` - sudo apt install containerd
- Run `sudo /etc/init.d/docker start` # systemd is not available on WSL, use this Step
- OR
- Run `containerd` - `sudo systemctl enable --now containerd`
- Install nerdctl - `wget https://github.com/containerd/nerdctl/releases/download/v0.12.1/nerdctl-0.12.1-linux-amd64.tar.gz`
- `nerdctl run -it --rm nginx`
@vs4vijay
vs4vijay / GetDataFromXPath
Created September 27, 2013 06:35
Extract Data from XPath via Google Apps Script
function getDataFromXpath(path, url) {
var data = UrlFetchApp.fetch(url);
var text = data.getContentText();
var xmlDoc = Xml.parse(text, true);
// Replacing tbody tag because app script doesnt understand.
path = path.replace("/html/","").replace("/tbody","","g");
var tags = path.split("/");
Logger.log("tags : " + tags);
// getting the DOM of HTML