Skip to content

Instantly share code, notes, and snippets.

View atparkweb's full-sized avatar
💭
🇯🇵

Andy Park atparkweb

💭
🇯🇵
View GitHub Profile
@atparkweb
atparkweb / tmux_config.txt
Last active May 7, 2025 00:46
Tmux Config
## command prefix
unbind C-b
set-option -g prefix C-a
## better window splitting
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
@atparkweb
atparkweb / dev_environment.md
Last active May 12, 2025 02:30
Dev Environment Tools

Tools of my daily work life

Summary

Notes on which tools I use at work daily.

Terminal

  • tmux - Multiple terminal sessions
  • fzf - Fuzzy search of command history
  • LazyGit - Minimal Git interface
@atparkweb
atparkweb / binary_to_hex.org
Last active July 13, 2023 09:34
Binary to Hex
BinaryHex
00000
00011
00102
00113
01004
01015
01106
01117
@atparkweb
atparkweb / gist:9e58c956ef5a8934e43699265368fc2f
Created July 13, 2023 07:40
Decimal to binary representation
1. If it's even emit a '0', if it's odd emit a '1'.
2. Divide the number by 2 and discard fractional component or remainder.
3. If the quotient is 0, the algorithm is done.
4. If the quotient is not 0 and the number is odd, insert a '1' before the current string.
5. If the quotient is not 0 and the number is even, prefix the string with a '0'.
6. Go back to step 2 and repeat.
@atparkweb
atparkweb / canonical_model.md
Created April 24, 2023 02:00
Canonical model structure

Canonical Model Structure

Overview

Facts about a system can be organized into three categories:

  • Domain
  • Design
  • Code

Domain

Facts that are "just true". Should not contain any facts about implementation details

{
"Print formatted log to console": {
"scope": "javascript,typescript,javascriptreact,typescriptreact",
"prefix": "log",
"body": [
"console.log(`%cDEVLOG --> %O`, 'color:#7bfa61;font-size:14px;font-weight:bold;', $1);",
],
"description": "Log styled output to console"
}
}
1. If it can break, it should be tested. This includes models, views, forms, templates, validators, and so forth.
2. Each test should generally only test one function.
3. Keep it simple. You do not want to have to write tests on top of other tests.
4. Run tests whenever code is PULLed or PUSHed from the repo and in the staging environment before PUSHing to production.
5. When upgrading to a newer version of Django:
a. upgrade locally,
b. run your test suite,
c. fix bugs,
d. PUSH to the repo and staging, and then
e. test again in staging before shipping the code.
@atparkweb
atparkweb / single-project-django.md
Last active June 7, 2022 12:54
Django: Single Project Setup

Run the following if you are working a single project Django application:

    $ python3 -m venv venv
    $ source venv/bin/activate
    $ pip install Django
    $ django-admin startproject personal_portfolio
    $ mv <project name>/manage.py ./
    $ mv <project name>/<project name>/* <project name>

$ rm -r //

@atparkweb
atparkweb / elixir_server_heuristics.md
Last active December 23, 2021 14:17
Task, Agent, or GenServer?

Elixir Server Process Heuristics

Use a Task if you want to perform a one-off computation or query asynchronously.

Use an Agent if you just need a simple process to hold state.

Use a GenServer if you need a long-running server process that store states and performs work concurrently.

Use a dedicated GenServer process if you need to serialize access to a shared resource or service used by multiple concurrent processes.

@atparkweb
atparkweb / prolog_design_process
Created February 24, 2021 14:05
Building an Expert System in Prolog
1. Write a brief description about the knowledge we have for the system and from that knowledge we’ll make the factor table
2. From factor table we’ll write rules (production rules)
3. Write those rules in Prolog
A *factor table* is a simple table can be made using a excel sheet and is a part of **Knowledge Representation**.
*Knowledge representation* is a brief note of the expert system.
In factor table we just represent the knowledge we have and this makes it easy for us to write rules and facts.