Skip to content

Instantly share code, notes, and snippets.

function parse(str) {
let tmp = str.trim().toUpperCase()
tmp = tmp.replaceAll(" ", "")
tmp = tmp.replaceAll(":", "")
let matches = tmp.match(/([0-9]{1,4})(AM|PM)/g)
if (matches.length === 0) {
return
@shivpatel
shivpatel / principles.md
Created October 18, 2021 15:25
Programming Principles

Programming Principles

A list of programming principles I follow. A special thanks to my peers who have instilled many of these principles on me.

Structure like a chef.

Organize models, services, controllers, etc. (ingredients) by component (recipe) then type (food group). Contributors (sous-chefs) can focus on a single component (recipe) without needing to jump around the entire project (kitchen).

app/
├─ component/