Skip to content

Instantly share code, notes, and snippets.

View terentz's full-sized avatar

Tristan Rentz terentz

View GitHub Profile
@judge2020
judge2020 / explorer.sh
Last active May 26, 2019 14:38
Open explorer at folder - bash script for Bash on Ubuntu On Windows
#!/bin/bash
#
# START CONFIG
#
# Change driveletter below if windows is installed on something other than the C drive
driveletter=c
#
# END CONFIG
#
#
0x00 0 STOP
0x01 3 ADD
0x02 5 MUL
0x03 3 SUB
0x04 5 DIV
0x05 5 SDIV
0x06 5 MOD
0x07 5 SMOD
0x08 8 ADDMOD
0x09 8 MULMOD

System Design Cheatsheet

Step One: Framing The Problem a.k.a get the MVP

  • Identify the use cases that are in scope
  • Determine constraints based on scoped use cases

use case : the things your system needs to be do.

constraints : the things your system will have to consider to be able to do stuff

var fs = {
read: (filename, cb, err) => {
navigator.webkitPersistentStorage.requestQuota(0, (bytes) => {
window.webkitRequestFileSystem(PERSISTENT, bytes, (fs) => {
fs.root.getFile(filename, {},
(entry) => {
entry.file((file) => {
var reader = new FileReader();
if(err)
reader.onerror = err;
@HR
HR / npm-update-latest.sh
Last active March 30, 2018 21:46
NPM update all global packages to latest version
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f2 | sed 's/@.*//g')
do
npm -g install "$package@latest"
done
@vasanthk
vasanthk / System Design.md
Last active May 6, 2025 12:04
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?
@dotcomputercraft
dotcomputercraft / gist:b7283bd52f4b5389e748
Last active June 29, 2024 18:52
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
the best way (I've found) to completely uninstall node + npm is to do the following:
go to /usr/local/lib and delete any node and node_modules
go to /usr/local/include and delete any node and node_modules directory
if you installed with brew install node, then run brew uninstall node in your terminal
check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
go to /usr/local/bin and delete any node executable
You may need to do the additional instructions as well:
sudo rm /usr/local/bin/npm
@staltz
staltz / introrx.md
Last active May 6, 2025 07:45
The introduction to Reactive Programming you've been missing
@twinforces
twinforces / gist:8548404
Created January 21, 2014 21:07
This is a cheat sheet for Multi-Markdown.
Title: MMD Cheat Sheet
Author: Pierce T. Wetter III
Email: [email protected]
Date: September 6, 2013
### Basics ###
| What | | Syntax |
| :------------ | -- | :----------- |
| *Italic* | | \*Italic\* or \_Italic\_|