Skip to content

Instantly share code, notes, and snippets.

View JohnDinhDev's full-sized avatar
🐢

John Dinh JohnDinhDev

🐢
  • Philadelphia, Pennsylvania
View GitHub Profile
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
#! /bin/bash
username=result=${PWD##*/}
add-apt-repository ppa:neovim-ppa/unstable # neovim ppa
echo "Installing git..."
if ! command -v git &> /dev/null # install node if it isn't already
then
apt install git
@JohnDinhDev
JohnDinhDev / gist:9cdf72ac2e7bc7587ba83237ae91070d
Last active October 27, 2021 06:17
10/26/21 init.vim for jeff
" =============================
" Shortcut Cheat Sheet
" =============================
"
" Find a section with it's coresponding section number or section name
" example '/2.' or '/Tabs'
"
" 1. Essentials
" 2. Movement
" 2. Tabs
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDIYllvcSiB6EDrpDe9+YpjWWDpGcviS/QgA7FEAzqxOxAkRPaCfw0BPpL3SPFwNR7L12Ut43z+CtPuybG+RcC3ekuSPYDRIio3Mkyt8/x0mR5kL6Wye8frXoXh+2jcPb1MOTSLCkb8BSqWWvS9FewKEBZvv2FqdgJD+J+FqBG79KVN+SOCiWoF3El6ztpOotBUsZ3Iel3Hni+59c3hhZd4OEspM8dNI8zvzhIeB1cpuyBf5jPLl4X5BRRJQjsPZ6ohLlZFHX0kuFAwiA8DNlP9OM2GOTldhfUfxXbypeouMGwpOrWuOUdzqP9uLA0K6KpcHUiB3z7h0UJdjP041NIp+HUlF6LmfEp3Jd8l0sfoxajkglH8GC0aVCSQx9pgB7RUZIbYenYdpm/ybJHIKuziqASYq2BjXzrJjOFeBVMbGbXUUsa94pPlAZ85vohzJxEfgRtvGsciuQhuZLyTaLL70UPPpfCwojH1b6A/0t5uOMl6HAneiDwrQBC1O+vGo8s= john@DESKTOP-Q9V1DL1
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
import XMonad
import Data.Monoid
import System.Exit
import XMonad.Util.Run
import XMonad.Util.SpawnOnce
import XMonad.Layout.Spacing
import XMonad.Layout.ToggleLayouts
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.DynamicLog
@JohnDinhDev
JohnDinhDev / Reset Udemy Progress.md
Last active April 29, 2024 18:36
Reset Udemy Progress

Reset Udemy Progress

Last Updated: 09/30/2022

Step 1. Go to Udemy course in browser

Go to the course and have any video up. The following code relies on the right sidebar to be visible to uncheck all your progress.

Step 2. Open browser console

You can do this with ctrl+shift+j and making sure the console tab is selected for chrome/brave

prompt_context () { }
prompt_dir() {
prompt_segment blue black '%2~'
}
" Sets ";" key to be the leader
let mapleader=";"
inoremap ;q <Esc> " Map ';q' to Esc key
" Specify a directory for plugins
call plug#begin('~/.local/share/nvim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'preservim/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'ryanoasis/vim-devicons'
@JohnDinhDev
JohnDinhDev / GoogleAuth.component.jsx
Created March 19, 2020 19:07
Google oAuth React Component
import React, { Component } from "react";
import { connect } from "react-redux";
import { signIn, signOut } from "../actions";
class GoogleAuth extends Component {
async componentDidMount() {
await window.gapi.load("client:auth2", () => {
window.gapi.client.init({
clientId: