Skip to content

Instantly share code, notes, and snippets.

View njwest's full-sized avatar
🎹
Groovin

Nick West 韋羲 njwest

🎹
Groovin
View GitHub Profile
const path = require('path');
module.exports = {
publicPath: './',
lintOnSave: false,
runtimeCompiler: true,
devServer: {
stdin: true
}
}
@njwest
njwest / bootstrap-table-example.vue
Created September 19, 2018 07:08
Bootstrap HTML/CSS Table with Bootstrap-Vue Input
// Uses regular HTML tables with bootstrap CSS classes - https://getbootstrap.com/docs/4.1/content/tables/
// Uses VueJS bootstrap-4 b-form-textarea form input: https://bootstrap-vue.js.org/docs/components/form-textarea
<template>
<!-- div that makes table responsive with horizontal scrollbar on small screens -->
<div class="table-responsive">
<table class="table table-bordered">
<!--
@njwest
njwest / gist:ff7a570f9ba6fa3b897356938f6e9491
Created July 29, 2018 13:20 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@njwest
njwest / LoggedIn.js
Created March 27, 2018 16:43
screens/LoggedIn.js completed
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Button, Loading } from '../components/common/';
import axios from 'axios';
export default class LoggedIn extends Component {
constructor(props){
super(props);
this.state = {
loading: true,
@njwest
njwest / LoggedIn.js
Last active March 24, 2018 13:47
LoggedIn.js deleteJWT button onPress prop
# snip
render() {
return(
<View style={styles.container}>
<Button onPress={this.props.deleteJWT}>
Log Out
</Button>
</View>
);
@njwest
njwest / App.js
Created March 24, 2018 13:39
src/App.js final render
# App.js render method
render() {
if (this.state.loading) {
return (
<Loading size={'large'} />
);
} else if (!this.state.jwt) {
return (
<Auth newJWT={this.newJWT} />
@njwest
njwest / App.js
Last active March 24, 2018 13:38
Full App.js constructor
# snip
export default class App extends Component {
constructor() {
super();
this.state = {
jwt: '',
loading: true
}
@njwest
njwest / App.js
Created March 24, 2018 13:24
src/App.js
# snip
import deviceStorage from './services/deviceStorage.js';
export default class App extends Component {
constructor() {
super();
this.state = {
jwt: '',
}
@njwest
njwest / deviceStorage.js
Created March 24, 2018 13:12
services/deviceStorage.js
import { AsyncStorage } from 'react-native';
const deviceStorage = {
# code omitted for brevity
async deleteJWT() {
try{
await AsyncStorage.removeItem('id_token')
.then(
() => {
@njwest
njwest / deviceStorage.js
Created March 24, 2018 13:04
services/deviceStorage.js loadJWT()
import { AsyncStorage } from 'react-native';
const deviceStorage = {
# code removed for brevity
async loadJWT() {
try {
const value = await AsyncStorage.getItem('id_token');
if (value !== null) {
this.setState({