Skip to content

Instantly share code, notes, and snippets.

@scootcho
scootcho / grokking_to_leetcode.md
Created August 12, 2023 08:26 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@scootcho
scootcho / dokku_setup.md
Created July 4, 2022 08:19 — forked from ungoldman/dokku_setup.md
Deploy your own PaaS: Setting up Dokku with DigitalOcean and Namecheap

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.


This write-up is very out of date! You probably shouldn't use it.

@scootcho
scootcho / ngrok-and-jetpack.md
Created February 17, 2022 02:40 — forked from mjangda/ngrok-and-jetpack.md
How to connect ngrok to your local WordPress environment (props @DanReyLop)

How to develop with Jetpack locally with ngrok

To connect Jetpack in your local installation, you'll need a way for WP.com servers to reach your server. That can be done in a number of different ways:

  • You can open your router's ports and use your public IP
  • You can use some kind of Dynamic DNS provider.

But these options fall short of ngrok, which is a "localhost tunnel". It basically allows the Internet to hit a local port on your machine without worrying about ports or IPs.

As long as ngrok is running, Jetpack / WP.com will be able to communicate with your local site. This will allow remote modules like Site Search and Manage to work.

@scootcho
scootcho / git-checkout-all-branches.sh
Created July 27, 2021 21:23 — forked from ElfSundae/git-checkout-all-branches.sh
Git checkout all remote branches
#!/bin/bash
remote=origin ; for brname in `git branch -r | grep $remote | grep -v /master | grep -v /HEAD | awk '{gsub(/^[^\/]+\//,"",$1); print $1}'`; do git branch --track $brname $remote/$brname || true; done 2>/dev/null
@scootcho
scootcho / docker-mongo-repair
Created July 26, 2021 05:25 — forked from mtrunkat/docker-mongo-repair
Run "mongo --repair" in Docker container that cannot start because of MongoDB error
#!/bin/bash
# See https://github.com/docker-library/mongo/pull/63
docker run --rm --volumes-from my-mongo-server mongo unlink "/data/db/mongod.lock"
docker run --rm --volumes-from my-mongo-server mongo --repair
@scootcho
scootcho / express_postgress_knex.md
Created July 20, 2021 23:22 — forked from laurenfazah/express_postgress_knex.md
Cheat Sheet: Setting up Express with Postgres via Knex

Express & Postgres via Knex

Note: <example> is meant to denote text replaced by you (including brackets).

Setup

// global dependencies
npm install -g knex
@scootcho
scootcho / Named Hashmasks
Created March 2, 2021 18:04 — forked from yuradmt/Named Hashmasks
Hashmasks - named NFTs
{"id":0,"name":"Bitcoin","owner":"0xc0F030eac8b588817f8dA16b9a2CDCcc6451B25c"}
{"id":1,"name":"Trump","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
{"id":2,"name":"King","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
{"id":3,"name":"Joe","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
{"id":4,"name":"china","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
{"id":5,"name":"usa","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
{"id":6,"name":"love","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
{"id":7,"name":"covid19","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
{"id":8,"name":"Obama","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
{"id":9,"name":"buterin","owner":"0x874c44A007168b1f4B260Bc7017504D151b0aF7a"}
@scootcho
scootcho / hardhat-openzeppelin-project.md
Created March 2, 2021 02:21 — forked from alkavan/hardhat-openzeppelin-project.md
Hardhat and OpenZeppelin project bootstrap for Ethereum contract development

Install Instructions

Install Hardhat

npm install --save-dev hardhat

Initiate a new Hardhat project (in empty directory)

npx hardhat
@scootcho
scootcho / domain-driven-design-cheatsheet.txt
Created February 1, 2021 22:38 — forked from jahe/domain-driven-design-cheatsheet.txt
Domain Driven Design Cheatsheet
tldr;
DDD is primarily about modeling a Ubiquitous (= überall vertreten) Language in an Bounded Context.
It avoids the design of monolithic applications.
Use DDD when the business model complexity is high (higher than the technical aspects of the project).
Bounded Context - semantic contextual boundary
Within the boundary, each component of the software model has a specific meaning and does specific things
The components inside a Bounded Context are context specific and semantically motivated.
In the Beginning of software modeling the Bounded Context is only coceptual and is part of the Problem Space.
@scootcho
scootcho / domain-driven-design-cheatsheet.txt
Created February 1, 2021 22:38 — forked from jahe/domain-driven-design-cheatsheet.txt
Domain Driven Design Cheatsheet
tldr;
DDD is primarily about modeling a Ubiquitous (= überall vertreten) Language in an Bounded Context.
It avoids the design of monolithic applications.
Use DDD when the business model complexity is high (higher than the technical aspects of the project).
Bounded Context - semantic contextual boundary
Within the boundary, each component of the software model has a specific meaning and does specific things
The components inside a Bounded Context are context specific and semantically motivated.
In the Beginning of software modeling the Bounded Context is only coceptual and is part of the Problem Space.