Skip to content

Instantly share code, notes, and snippets.

@scootcho
scootcho / git commands.md
Last active April 11, 2024 03:53
git commands #git #commands

initialize git depository in the current directory

git init .

display the git remote/origin

cat .git/config
@scootcho
scootcho / EpsBulkConvertSVG.js
Created June 16, 2020 03:26
adobe illustrator EPS to SVG bulk conversion
/**********************************************************
DESCRIPTION
This sample gets files specified by the user from the
selected folder and batch processes them and saves them
as SVGs in the user desired destination with the same
@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 / rails commands.md
Last active September 30, 2022 09:23
rails console commands #rails #console #commands

open gem using bundler (in app root directory)

bundle open gem_name
bundle open activesupport

clear the console

control + l
command + k (mac)
@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 / advanced-active-record.md
Created February 13, 2016 07:09 — forked from stujo/advanced-active-record.md
Advanced Active Record Notes
@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