Skip to content

Instantly share code, notes, and snippets.

@brandonjyee
brandonjyee / angular-commands.bash
Last active May 22, 2020 15:19
[Angular] Quick & Dirty cheatsheet
The following are common command-line commands for using Angular. Assumes you have node.js already installed, which is a prerequisite.
npm i npm # Update to the latest version of node package manager (npm). May be necessary to have latest version so in order to d/l some packages.
# npm is basically a super popular software registry that has hundreds of thousands of packages you can install via npm commands. Angular and ReactJS rely on it to install their modules.
npm install -g @angular/cli # use to install the angular Command-Line Interface (CLI). Any commands that start with "ng" are using the CLI.
ng new my-app # Create a new app called "my-app". Creating a new app takes me ~10+ mins on my laptop b/c it generates ~300MB of files, so feel free to grab a cup of coffee in the meantime.
cd my-app # Go to the new app’s directory to serve it
ng serve --open # Command to serve the app locally at
@brandonjyee
brandonjyee / spring_app_as_linux_service.gist
Last active February 2, 2024 15:05
Deploying Spring Boot app as a Linux service
This method uses the modern systemd way to run a Java JAR (i.e. a Spring Boot app) as a daemon as opposed to using the older method of using init.d (SystemV). Using the "&" symbol to run the process in the background isn't sufficient b/c the process will be shut down when the terminal closes (or when you exit your SSH session if remoting in to the machine). Using the "nohup" command is another option, but that is like the "poor man's way" of running a service: doesn't restart on machine reboot; program ignores interrupts, quit signals, and hangups. For more info see: https://stackoverflow.com/questions/958249/whats-the-difference-between-nohup-and-a-daemon .
Anyways, to create a Linux daemon the systemd way:
Create a service file in /etc/systemd/system. Let's call it javaservice.service. Let the contents be:
[Unit]
Description=My Java Service
[Service]
{
"extends": "eslint:recommended",
"rules": {
"dot-notation": 1,
"valid-typeof": 2
}
}
module.exports = {
// printWidth: 80, // 80
// tabWidth: 2, // 2
// useTabs: false, // false
// semi: true, // true
singleQuote: true, // false
trailingComma: 'es5', // none | es5 | all
// bracketSpacing: true // true
// jsxBracketSameLine: false // false
// arrowParens: avoid // avoid | always
@brandonjyee
brandonjyee / eslintrc.json
Last active July 5, 2018 15:18
eslint + prettier + fullstack
{
"extends": ["fullstack"],
"parser": "babel-eslint",
"rules": {
"semi": [1, "always"],
"linebreak-style": "off",
"quotes": "off",
"semi": "off"
}
}
@brandonjyee
brandonjyee / settings.json
Created May 1, 2018 03:16
Recommend setting for VSCode
{
"editor.renderIndentGuides": true,
"editor.renderWhitespace": "boundary",
"editor.renderControlCharacters": false,
"editor.rulers": [80, 100],
"editor.tabSize": 2,
"editor.trimAutoWhitespace": false,
"editor.wordWrap": "on",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
@brandonjyee
brandonjyee / settings.json
Created May 1, 2018 03:18
Default VSCode settings
{
"explorer.confirmDelete": false
}
@brandonjyee
brandonjyee / .editorconfig
Created May 1, 2018 15:14
Sample config file for VSC EditorConfig extension
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true

class: center middle

Dictionary Word Finder

<style> .remark-code { white-space: pre-wrap; } </style>