Skip to content

Instantly share code, notes, and snippets.

Working from home

Kevin Murimi kevthanewversi

Working from home
View GitHub Profile
vasanthk / System
Last active June 3, 2023 20:14
System Design Cheatsheet
View System

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
pksunkara / config
Last active June 3, 2023 13:20
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
View config
name = Pavan Kumar Sunkara
email =
username = pksunkara
defaultBranch = master
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
kachayev /
Last active March 15, 2023 07:55
Dijkstra shortest path algorithm based on python heapq heap implementation
from collections import defaultdict
from heapq import *
def dijkstra(edges, f, t):
g = defaultdict(list)
for l,r,c in edges:
q, seen, mins = [(0,f,())], set(), {f: 0}
while q:
View primer.js
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
return elm;
sergiotapia / images_dimensions.go
Last active November 23, 2022 03:53
Golang - Getting the dimensions of an image. jpg, jpeg, png
View images_dimensions.go
package main
import (
_ "image/jpeg"
_ "image/png"
kamermans /
Last active April 4, 2022 08:14
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
# NOTE: Since Docker 1.10 (February 4, 2016), it has been possible to configure the
# Docker daemon using a JSON config file. On Linux, this file is normally located at
# /etc/docker/daemon.json. You should use this JSON config method if you are running
# a version of Docker that is at least 1.10!
# Here is an example configuration that sets the docker0 bridge IP to
# {
# "bip": ""
# }
flaviocopes / check-substring-ends-with.go
Last active November 15, 2021 09:34
Go: check if a string ends with a substring #golang
View check-substring-ends-with.go
package main
import (
func main() {
strings.HasSuffix("foobar", "bar") // true
xigang / sort_time.go
Created May 4, 2017 04:04
Sorting by time.Time in Golang
View sort_time.go
package main
import (
type reviews_data struct {
review_id string
valentin2105 /
Last active July 6, 2018 10:16
Manage a Ganeti Cluster
Add a VM in plain disk:
gnt-instance add plain --disk 0:size=20G --disk 1:size=200M \
-B memory=2G,vcpus=2 -o debootstrap+jessie --no-ip-check \ 
Add a VM in DRBD (fully-sharred between two servers) :
gnt-instance add drbd --disk 0:size=20G --disk 1:size=200M \
-B memory=2G,vcpus=2 -o debootstrap+jessie --no-ip-check \
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">