Skip to content

Instantly share code, notes, and snippets.

View wulymammoth's full-sized avatar
processing unit

David W wulymammoth

processing unit
View GitHub Profile
version: "3.7"
services:
db:
environment:
- POSTGRES_USER=postgres
image: postgres
ports:
- "5432:5432"
restart: always

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

/*
* nth-fib in both recursive and iterative (dynamic programming)
*
* 0, 1, 1, 2, 3, 5, 8, 13, 21
*/
// time: O(2^N) -- derived from branches (2) to the power of it's maximum depth (N); it is EXPONENTIAL
// space: O(N) -- derived from space used on the call-stack, the recursion will go down to N
function fibRecursive(n) {
if (n <= 1) return n;
@wulymammoth
wulymammoth / how-to-copy-aws-rds-to-local.md
Created April 26, 2020 02:43 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@wulymammoth
wulymammoth / values_pointers.go
Created April 22, 2020 06:58 — forked from josephspurrier/values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
function add(a, b) {
return a + b;
}
const cases = [
// [a, b], expectedAnswer
[[1, 2], 3], // 3
[[5, 5], 10],// 10
[[-1, 2], 1], // 1
[[1, 1], 2]
@wulymammoth
wulymammoth / poodir-notes.md
Created July 19, 2019 06:51 — forked from elissonmichael/poodir-notes.md
Notes From "Practical Object-Oriented Design In Ruby" by Sandi Metz

Chapter 1 - Object Oriented Design

The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.

SOLID Design:

  • Single Responsibility Principle: a class should have only a single responsibility
  • Open-Closed Principle: Software entities should be open for extension, but closed for modification (inherit instead of modifying existing classes).
  • Liskov Substitution: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
  • Interface Segregation: Many client-specific interfaces are better than one general-purpose interface.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./simple_server.py [<port>]
Send a GET request::
curl http://localhost
@wulymammoth
wulymammoth / dummy-web-server.py
Created May 19, 2019 21:26 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@wulymammoth
wulymammoth / domain_driven_design.md
Created January 21, 2019 23:30
Domain-Driven Design

Domain-driven Design (DDD)

Context mapping

Exercise to help us discover all the concepts living in our organization, and our systems

Get everyone in a room and discover the...

  • Nouns - entities
  • Verbs - events