Skip to content

Instantly share code, notes, and snippets.

View AstralJohn's full-sized avatar
🐢

John Dinh AstralJohn

🐢
View GitHub Profile
@AstralJohn
AstralJohn / example.component.jsx
Last active March 19, 2020 16:37
React Redux Setup With DevTools
import React from "react";
import { connect } from "react-redux";
// Import your actions from your action's index.js file
// import { action1, action2 } from '../actions'
const ExampleComponent = ({ stateKey1, stateKey2, action1, action2 }) => {
// alternatively, ExampleComponent = (props) => ....
// const {stateKey1, stateKey2, action1, action2} = props;
@AstralJohn
AstralJohn / 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:
prompt_context () { }
prompt_dir() {
prompt_segment blue black '%2~'
}
# 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 `~/`.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDIYllvcSiB6EDrpDe9+YpjWWDpGcviS/QgA7FEAzqxOxAkRPaCfw0BPpL3SPFwNR7L12Ut43z+CtPuybG+RcC3ekuSPYDRIio3Mkyt8/x0mR5kL6Wye8frXoXh+2jcPb1MOTSLCkb8BSqWWvS9FewKEBZvv2FqdgJD+J+FqBG79KVN+SOCiWoF3El6ztpOotBUsZ3Iel3Hni+59c3hhZd4OEspM8dNI8zvzhIeB1cpuyBf5jPLl4X5BRRJQjsPZ6ohLlZFHX0kuFAwiA8DNlP9OM2GOTldhfUfxXbypeouMGwpOrWuOUdzqP9uLA0K6KpcHUiB3z7h0UJdjP041NIp+HUlF6LmfEp3Jd8l0sfoxajkglH8GC0aVCSQx9pgB7RUZIbYenYdpm/ybJHIKuziqASYq2BjXzrJjOFeBVMbGbXUUsa94pPlAZ85vohzJxEfgRtvGsciuQhuZLyTaLL70UPPpfCwojH1b6A/0t5uOMl6HAneiDwrQBC1O+vGo8s= john@DESKTOP-Q9V1DL1
" 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'
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
#! /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
@AstralJohn
AstralJohn / 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
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