Skip to content

Instantly share code, notes, and snippets.

View markhilton's full-sized avatar

Mark Hilton markhilton

  • Miami, FL
View GitHub Profile

Our Javascript Application Architecture & Principles

Welcome and we are happy to have you as our new team member!

This document describes the architectural goals and principles we’re trying to achieve as a team with respect to the project's codebase we develop and maintain. We hope it will help you to quickly get set up and become a valuable contributor.

Your IDE

  • Use eslint & prettier to enforce consistent coding style
@markhilton
markhilton / cloudbuild.yaml
Created January 15, 2021 20:00
Cloud Build for Firebase NodeJS app with start/complete/fail slack notifications
steps:
# build docker image
- name: "gcr.io/cloud-builders/docker"
entrypoint: "bash"
args:
- "-c"
- |
curl -X POST -H "Content-type: application/json" --data \
'{"text":"`gcr.io/$PROJECT_ID/$REPO_NAME:$BRANCH_NAME$TAG_NAME` build ID `$BUILD_ID` started!"}' $_WEBHOOK_URL
docker build \
@markhilton
markhilton / .eslintrc.json
Created January 15, 2021 17:20
ESlint rules for VUE CLI projects
{
"root": true,
"globals": {
"dataLayer": "writable"
},
"extends": [
"eslint:recommended",
"plugin:vue/recommended"
],
"rules": {
@markhilton
markhilton / .eslintrc.json
Created January 15, 2021 17:17
ESlint rules for Google Cloud Functions projects
{
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
},
"plugins": [
@markhilton
markhilton / index.js
Last active March 6, 2019 17:41
Firebase Google Cloud Functions REST router
require('dotenv').config({ path: __dirname + '/.env' })
const fs = require('fs')
const api = require('./middleware/router')
const functions = require('firebase-functions')
// runtime options
const runtimeOpts = {
memory: '256MB',
timeoutSeconds: 500
@markhilton
markhilton / k8roll
Created October 21, 2018 23:05
Kubernetes force rolling update on deployment. Usage: k8roll [required: deployment name] [optional: namespace]
#!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -ge 1 ] || die "ERROR: deployment name argument is required, $# provided"
NAMESPACE=${2:-default}
@markhilton
markhilton / fix_privileges.sh
Created October 21, 2018 19:44
Set recursively default directories (755) & files (644) privileges. Usage: fix_privileges.sh $path
#!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "ERROR: path argument is required, $# provided"
if [[ ! -d "$1" ]]; then
@markhilton
markhilton / cloudbuild.yaml
Last active March 12, 2022 18:20
Google Cloud Build: K8s application rolling update deployment on repository code push
steps:
# slack deployment status
- name: 'gcr.io/cloud-builders/curl'
args: [ '-X', 'POST', '-H', 'Content-type: application/json', '--data',
'{"text":"`gcr.io/$PROJECT_ID/$_DEPLOYMENT:$BRANCH_NAME$TAG_NAME` build started!"}', '${_WEBHOOK_URL}' ]
# build docker image
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '--build-arg', 'TOKEN=${_OAUTH_TOKEN}',
'-t', 'gcr.io/$PROJECT_ID/$_DEPLOYMENT:$BRANCH_NAME$TAG_NAME', '.' ]
@markhilton
markhilton / mdbootstrap-laravel-spark.md
Last active May 18, 2022 08:54
How to install mdbootstrap in Laravel Spark framework

How to install mdbootstrap in Laravel Spark framework

Those steps were followed in order to install mdbootstrap in Laravel Spark 6.0 framework.

STEP 1: install dependencies

npm i mdbootstrap
npm i node-waves