Skip to content

Instantly share code, notes, and snippets.

View louishuyng's full-sized avatar

Louis Nguyen louishuyng

View GitHub Profile
@louishuyng
louishuyng / job-stories.md
Created June 10, 2024 15:00
How to create job stories for API
ID When. . . I want to. . . So I can. . .
1 I want to see the new books that have been released List recently added books Keep up with the latest watercooler talk
2 I want to find a book that will be entertaining or teach me something new Search for a book by topic or keyword Browse related books

Trigger event or situation + capability + outcome

When ... + I want to ... + So I can

@louishuyng
louishuyng / README.md
Created May 10, 2024 08:30
ADR Template

[short title of solved problem and solution]

  • Status: [proposed | rejected | accepted | deprecated | … | superseded by ADR-0005]
  • Deciders: [list everyone involved in the decision]
  • Date: [YYYY-MM-DD when the decision was last updated]

Technical Story: [description | ticket/issue URL]

Context and Problem Statement

@louishuyng
louishuyng / rfc-template.md
Last active June 16, 2024 05:28 — forked from michaelcurry/rfc-template.md
RFC (Request for Comments) Template [Markdown]

RFC Template

Feature Name: (fill me in with a unique identity, myawesomefeature)

Type: (feature, enhancement)

Start Date: (fill me in with today's date, YYYY-MM-DD)

Author: (your names)

@louishuyng
louishuyng / main.ts
Created April 22, 2024 14:19
Event Tracking With Typescript
const trackEvent = <T extends PendoEvents>(
event: T,
...args: T extends PendoEvents
? PendoData[T] extends null
? []
: [PendoData[T]]
: []
) => {
PendoTrackEvent.track({
window.pendo,
@louishuyng
louishuyng / model.ts
Created April 16, 2024 04:18
Model on FE
import { Profile } from "./profile";
import { User } from "./user";
const types = {
user: User,
profile: Profile,
};
export class Model {
static fromJson<
@louishuyng
louishuyng / .rubocop.yml
Last active March 27, 2024 15:46
Custom Rubocop
require:
- ./lib/rubocop/cop/lint_rails_env
Lint/RailsEnv:
Enabled: true
Exclude:
- 'config/**/*.rb'
@louishuyng
louishuyng / .vimrc
Created January 7, 2024 09:56
Basic Vim Setup on Linux
set tabstop=2 softtabstop=2 shiftwidth=2
set expandtab
set number ruler
set autoindent smartindent
syntax enable
filetype plugin indent on
nnoremap <space>w :w<CR>
nnorempa <space>q :wq!<CR>
@louishuyng
louishuyng / nmap.sh
Last active December 3, 2023 15:16
Nmap useful commands
# Chekc vulnable at port in specific addr
nmap -p 80 --script vuln 192.168.0.184
@louishuyng
louishuyng / track_call_stack.rb
Created November 13, 2023 10:57
Track class Stack rails
#!/usr/local/bin/ruby
require 'rubygems'
require 'call_stack'
require 'pp'
class Test
def foo
bar
end
@louishuyng
louishuyng / main.rb
Last active November 11, 2023 07:03
Ruby Runtime Feature Changes
p = Person.new
p.refresh # => (...)
Person.start_trace
p.refresh # => (...)
# -> refresh: 0.500 s.
Person.end_trace
p.refresh # => (...)