Skip to content

Instantly share code, notes, and snippets.

View xgenvn's full-sized avatar

TuNA xgenvn

View GitHub Profile
@xgenvn
xgenvn / .gitignore
Created January 11, 2022 14:41 — forked from pdxjohnny/.gitignore
Setting Up k3s for Serverless (knative) on a $5 DigitalOcean Droplet Using k3d
.terraform/
*.pem
*.tf
*.tfstate
*.yaml
*.backup
istio-*/
cert-manager-*/
*.swp
env
@xgenvn
xgenvn / 99-noto-mono-color-emoji.conf
Created July 29, 2020 04:02 — forked from IgnoredAmbience/99-noto-mono-color-emoji.conf
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf
@xgenvn
xgenvn / pg dump and restore guide.md
Last active December 21, 2021 16:34
pg dump & restore

Plain text format should work

docker exec -i shared_postgres_instance pg_dump -U postgres -W scons_com_vn_production > ~/backup/scons_com_vn_production.sql
docker exec -i shared_postgres_instance psql -U postgres scons_com_vn_prod -W < ~/backup/scons_com_vn_production.sql

binary format (tar, gzip) won't work using pipe

for backup, cp from container to host

@xgenvn
xgenvn / machine.js
Last active September 17, 2021 12:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@xgenvn
xgenvn / System Design.md
Created August 13, 2021 14:42 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@xgenvn
xgenvn / .vscode_launch.json
Created February 4, 2021 06:05 — forked from GuillaumeDesforges/.vscode_launch.json
Simplest use of TypeScript for node development with VS Code
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run server (dev)",
"type": "node-terminal",
"request": "launch",
@xgenvn
xgenvn / apolloServer2019.ts
Created February 3, 2021 10:45 — forked from nodkz/apolloServer2019.ts
GraphQL error tracking with sentry.io (ApolloServer 2019)
import express from 'express';
import { ApolloServer } from 'apollo-server-express';
import { ApolloServerPlugin } from 'apollo-server-plugin-base';
import * as Sentry from '@sentry/node';
Sentry.init({
environment: process.env.APP_ENV,
// see why we use APP_NAME here: https://github.com/getsentry/sentry-cli/issues/482
release: `${process.env.APP_NAME}-${process.env.APP_REVISION}` || '0.0.1',
dsn: process.env.SENTRY_DSN,
@xgenvn
xgenvn / model_vs_sync.md
Created January 31, 2021 17:27 — forked from AndreKR/model_vs_sync.md
Vue.js v-model vs. v-bind.sync

Vue.js: v-model vs. v-bind:<propname>.sync

These examples use the expression foo as the data source in the parent.

Prop name Event name
v-model="foo" value by default input by default
v-bind:<propname>.sync="foo" arbitrary update:<propname>

v-model

@xgenvn
xgenvn / The Technical Interview Cheat Sheet.md
Created January 23, 2021 15:58 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@xgenvn
xgenvn / get_wifi_SSID.sh
Last active November 16, 2020 12:50
Get wifi SSID
iw dev | grep ssid | sed -e 's/^[[:space:]]*ssid\ //'