Skip to content

Instantly share code, notes, and snippets.

View xgenvn's full-sized avatar

TuNA xgenvn

View GitHub Profile
@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\ //'
@xgenvn
xgenvn / guide.md
Created November 15, 2020 10:48
Pycharm Python console autoreload

Python console

import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
%load_ext autoreload
%autoreload 2

Django console

@xgenvn
xgenvn / libsecret-git-credentials.sh
Created October 15, 2020 15:49
Setup libsecret git gnome git credential
sudo apt-get install libsecret-1-0 libsecret-1-dev libglib2.0-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper \
/usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
@xgenvn
xgenvn / blackd.service
Last active November 18, 2023 18:40
BlackD Formatter as service
# /etc/systemd/system/blackd.service
# sudo systemctl start blackd
# sudo systemctl enable blackd
# sudo systemctl status blackd
[Unit]
Description=Black Formatter Service
[Service]
ExecStart=/home/brian/bin/miniconda3/bin/blackd --bind-host=127.0.0.1
@xgenvn
xgenvn / Fix sleep awake issues ubuntu 20.04.md
Created September 7, 2020 15:07
Fix sleep awake issues ubuntu 20.04
  • Symstom: NVIDIA 440.100, GPU 1060, Ubuntu 20.04
  • Solution: Edit /etc/default/grub
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" #
GRUB_CMDLINE_LINUX="nouveau.modeset=0 acpi_osi=! acpi_osi=\"Windows 2015\" acpi_backlight=vendor mem_sleep_default=deep acpiphp. disable=1" GRUB_CMDLINE_LINUX="nouveau.blacklist=1 acpi_rev_override=1 acpi_osi=Linux nouveau.modeset=0 pcie_aspm=force drm.vblankoffdelay=1 scsi_mod.use_blk_mq=1 nouveau.runpm=0 mem_sleep_default=deep"
@xgenvn
xgenvn / Makefile
Created August 12, 2020 14:23 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)