Skip to content

Instantly share code, notes, and snippets.

View yosevu's full-sized avatar

Yosevu Kilonzo yosevu

View GitHub Profile
@yosevu
yosevu / 01-directory-structure.md
Created January 27, 2019 21:20 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@yosevu
yosevu / dotfile-git-setup.md
Last active August 20, 2023 14:52
Dotfile Git Setup

Setup

  1. git init --bare $HOME/.dotfiles
  1. alias dot='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
  • Create an alias for git e.g. dot to configure the .dotfiles repository.
  1. dotfiles config --local status.showUntrackedFiles no
  • Configure Git to not show local files that are not being tracked when using commands like git status.
@yosevu
yosevu / metadata.json
Created June 4, 2022 07:02
Marlowe in depth 2
{"valueParameterInfo":[["Amount",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":""}]],"slotParameterDescriptions":[["DepositDeadline","Deadline for the deposit"],["ChoiceDeadline","Deadline for the choice"]],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Giver makes a payment to receiver","contractName":"MPP - Simple payment (Close)","contractLongDescription":"Giver makes a payment to receiver","choiceInfo":[]}
@yosevu
yosevu / metadata.json
Created June 4, 2022 01:10
Marlowe in depth
{"valueParameterInfo":[],"slotParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"","contractName":"","contractLongDescription":"","choiceInfo":[]}
@yosevu
yosevu / machine.js
Created April 12, 2021 11:02
Generated by XState Viz: https://xstate.js.org/viz
const lightBulbMachine = Machine({
id: 'lightBulb',
initial: 'unlit',
states: {
lit: {
on: {
BREAK: 'broken',
TOGGLE: 'unlit',
},
},
@yosevu
yosevu / disney-quotes.txt
Created March 31, 2021 17:36
Disney Quotes
“The flower that blooms in adversity is the most rare and beautiful of all” – Mulan
“All it takes is faith and trust”– Peter Pan
“The past can hurt. But the way I see it, you can either run from it or learn from it” – The Lion King
“Today is a good day to try” – The Hunchback of Notre Dame
“Just because it’s what’s done, doesn’t mean it’s what should be done” – Cinderella
“Some people are worth melting for” – Frozen
“The only way to get what you want in this world is through hard work” – The Princess and the Frog
“Can anybody be happy if they aren’t free?” – Beauty and the Beast
“The only thing predictable about life is its unpredictability” – Ratatouille
“Remember who you are” – The Lion King
@yosevu
yosevu / getNumberOfStars.js
Last active January 28, 2020 04:01
getNumberOfStars
// Fixtures
const FILLED_STAR = '<filled/>';
const EMPTY_STAR = '<empty/>';
const MAX_STARS = 5;
const numberOfStars = 3;
// Version 1
R.join('',
R.concat(
@yosevu
yosevu / local-host-browser-testing.md
Last active January 15, 2020 21:14
Test local host on other devices

Local Host Browser Testing on Other Devices

iOS

  • Find IP address

    • Check in Network Settings or
  • Enter ifconfig |grep inet in Terminal

  • Enter computer name and port number: computer-name:port

  • e.g. http://my-macbook-pro.local:1137/path-to-resource.

@yosevu
yosevu / lint-heat-map.txt
Created August 5, 2019 12:29
lint heat map
30:3 error Unexpected let, use const instead functional/no-let
30:7 error 'calendarData' is never reassigned. Use 'const' instead prefer-const
31:3 error Unexpected let, use const instead functional/no-let
33:3 error Unexpected loop, use map or reduce instead functional/no-loop-statement
34:5 error Using expressions to cause side-effects not allowed functional/no-expression-statement
34:5 error Modifying an existing object/array is not allowed functional/immutable-data
35:5 error Using expressions to cause side-effects not allowed functional/no-expression-statement
38:3 error Unexpected loop, use map or reduce instead functional/no-loop-statement
38:8 error Unexpected let, use const instead functional/no-let
39
@yosevu
yosevu / git-checkout-escape-wildcard.txt
Created July 2, 2019 11:52
git checkout escape wildcard
git checkout -- 'packages/**/package-lock.json'