Skip to content

Instantly share code, notes, and snippets.

View CEOehis's full-sized avatar
🏠
Working from home

Celestine Ekoh-Ordan CEOehis

🏠
Working from home
View GitHub Profile
@CEOehis
CEOehis / System Design.md
Created May 22, 2020 01:31 — forked from vasanthk/System Design.md
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?
const CENTS = 100;
function toCents(amount) {
return Math.ceil(amount * CENTS);
}
function toUSD(amount) {
return amount / CENTS;
}
function telephoneCheck(str) {
// Good luck!
const numberRegex = /^((\(\d{3}\)[ -]?)|(\d{3}[ -]?))\d{3}[ -]?\d{4}$/;
// check if it starts with 1
if(str.startsWith('1')) {
return numberRegex.test(
str.substring(1).trim()
);
}
return numberRegex.test(str);
@CEOehis
CEOehis / toPascalCase.js
Created October 15, 2019 18:06
Convert a sentence to pascal case with spaces stripped off.
function toPascalCase(text) {
text = text.trim();
return text.replace(/(\w)(\S*)(\s*)/g, // matches words and spaces
function(g0,g1,g2){
return g1.toUpperCase() + g2.toLowerCase();
}
);
}
brew cask install android-file-transfer \
google-chrome \
appcleaner \
caffeine \
cheatsheet \
docker \
doubletwist \
1password \
spectacle \
superduper \
@CEOehis
CEOehis / microservices.md
Created June 1, 2019 15:00
Notes from Microservices course

What are microservices

  • An approach to developing a single application as a suite of small services
  • Independently deployable, using automated deployment tools
  • Enable apps to be built by multiple teams using multiple tech stacks

Advantages

  • They help decrease the cost of change
  • Works very well in Devops context

Algorithmic Complexity

It is important to try as much as you can to get the order of complexity of your algorithms to be higher up the following heirachy than lower.

  • O(1): constant time
  • O(log n): logarithmic
  • O(n): linear
  • O(n log n): loglinear
  • O(n^C): polynomial
  • O(C^n): exponential
function getCurrentPosition() {
if (navigator.geolocation) {
return new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(resolve, reject);
});
} else {
return Promise.reject('geolocation is not available on this device');
}
}
brew cask install android-file-transfer
brew cask install
appcleaner
caffeine
cheatsheet
docker
doubletwist
flux
1password
spectacle
@CEOehis
CEOehis / install_fonts.sh
Created December 10, 2018 15:42 — forked from jaredmcqueen/install_fonts.sh
install all fonts on brew caskroom fonts
brew cask install \
caskroom/fonts/font-3270-nerd-font \
caskroom/fonts/font-3270-nerd-font-mono \
caskroom/fonts/font-abel \
caskroom/fonts/font-aboriginal-sans \
caskroom/fonts/font-abril-fatface \
caskroom/fonts/font-acme \
caskroom/fonts/font-allura \
caskroom/fonts/font-anonymouspro-nerd-font \
caskroom/fonts/font-anonymouspro-nerd-font-mono \