Skip to content

Instantly share code, notes, and snippets.

View robin-carry's full-sized avatar

Arpit Kumar robin-carry

  • San Francisco, USA
View GitHub Profile
@robin-carry
robin-carry / markdown_examples.md
Created March 18, 2024 16:35 — forked from cseeman/markdown_examples.md
Markdown for info panel/warning box

Examples for how to create your own info panel, warning box and other decent looking notification in GitHub markdown.

All the boxes are single/two cell tables or two row tables.

Warning box

❗ You have to read about this
@robin-carry
robin-carry / latency.txt
Created March 23, 2023 18:58 — 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
View: Pods(<namespace>)[number of pods listed]
NAME pod name
READY number of pods in ready state / number of pods to be in ready state
RESTARTS number of times the pod has been restarted so far
STATUS state of the pod life cycle, such as Running | ... | Completed
CPU current CPU usage, unit is milli-vCPU
MEM current main memory usage, unit is MiB
%CPU/R current CPU usage as a percentage of what has been requested by the pod
%MEM/R current main memory usage as a percentage of what has been requested by the pod
@robin-carry
robin-carry / gist:a7c833c63085d1c3c8e4c28758fa339d
Last active December 5, 2019 21:34
Java-To-Dart Dart Program
import 'dart:math';
abstract class Shape {
factory Shape(String type) {
if(type == 'circle') return Circle(2);
if(type == 'square') return Square(2);
throw 'Can\'t create shape';
}
num get area;
}