Skip to content

Instantly share code, notes, and snippets.

@vasanthk
vasanthk / System Design.md
Last active December 11, 2025 19:10
System Design Cheatsheet

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?
@trajakovic
trajakovic / fedora-install-nodejs.sh
Last active February 16, 2019 16:55
Install node.js on fedora (23+).(v5.10.1)
#!/usr/bin/env bash
func_check_for_root() {
if [ ! $( id -u ) -eq 0 ]; then
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7
fi
}
func_check_for_root
#SETUP PARAMS
@eduardocardoso
eduardocardoso / gist:99d970801a3879ba853d
Last active January 6, 2016 12:56
Script to download all images from facebook comments
var arr = [];
var imgs = document.querySelectorAll('div.mvs a[ajaxify]');
for (var i = 0; i < imgs.length; i++) { arr.push(imgs[i]); }
var a = document.createElement('a');
var re = RegExp("[?&]src=[^&]+")
arr.forEach(function (img) {
ajaxify = img.getAttribute('ajaxify');
encoded_img_url = re.exec(ajaxify)[0].substr(5);
decoded_img_url = decodeURIComponent(encoded_img_url);
a['href'] = decoded_img_url;
@lihnux
lihnux / StringToByteArray.js
Created August 6, 2014 06:05
Javascript Convert String to Byte Array
var url = "Hello World";
var data = [];
for (var i = 0; i < url.length; i++){
data.push(url.charCodeAt(i));
}
@ngpestelos
ngpestelos / remove-docker-containers.md
Last active October 8, 2025 18:58
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active November 30, 2025 00:48
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName