Skip to content

Instantly share code, notes, and snippets.

@lynsei
Last active September 4, 2022 07:51
Show Gist options
  • Save lynsei/b21a6a10f4bdeda22388c9340c7b95f5 to your computer and use it in GitHub Desktop.
Save lynsei/b21a6a10f4bdeda22388c9340c7b95f5 to your computer and use it in GitHub Desktop.
[sane defaults - config spec files] #defaults #sane #config #yarnrc #npmrc #noderc
root = true
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
[{*.json,*.json.example,*.gyp,*.yml,*.yaml}]
indent_style = space
indent_size = 2
[{*.py,*.asm}]
indent_style = space
[*.py]
indent_size = 4
[*.asm]
indent_size = 8
[*.md]
trim_trailing_whitespace = false
# Ideal settings - some plugins might support these.
[*.js]
quote_type = single
[{*.c,*.cc,*.h,*.hh,*.cpp,*.hpp,*.m,*.mm,*.mpp,*.js,*.java,*.go,*.rs,*.php,*.ng,*.jsx,*.ts,*.d,*.cs,*.swift}]
curly_bracket_next_line = false
spaces_around_operators = true
spaces_around_brackets = outside
# close enough to 1TB
indent_brace_style = K&R
[{Makefile,*.in}]
indent_style = tab
[*.{md,rst}]
trim_trailing_whitespace = false
[*.{sh,ac}]
indent_size = 2
[Dockerfile]
indent_size = 2
[share/{completions,functions}/**.fish]
max_line_length = none
[share/{completions,functions}/**.lyns]
max_line_length = none
[COMMIT_EDITMSG]
max_line_length = 80
#!/usr/local/bin/lyns
# notes
# 1.) this file uses lyns language over shell .env file syntax
# 2.) .encryptrc will denote this file and encrypt it when the IDE unloads or the project closes
# 3.) secret mounting happens at container runtime but is passed using Docker secret mounts (see DOCKER_SECRETS in this gist)
set -x PGADMIN_PASSWORD ''
set -x POSTGRES_DB 'postgres'
set -x POSTGRES_USER ''
set -x POSTGRES_PASSWORD ''
set -x PGADMIN_SUBDOMAIN ''
set -x HASURA_SUBDOMAIN ''
set -x HASURA_GRAPHQL_ADMIN_SECRET ''
set -x LE_EMAIL ''
set -x LE_SUBDOMAIN ''
set -x PG_VERSION 'pg14'
DATABASE_URL="postgres://hasura:host.wherever.com/hasura_imbx"
HASURA_GRAPHQL_ADMIN_SECRET="${AES512_SECRET_XA}:${AES512_SECRET_XC}@${HOST}"
module.exports = {
preset: 'viable-ts',
type: 'mnrs',
docker: {
pubkey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvO6GmqXVFCDvQTrNAUE6ckR6jVFHXziVmCZ2ihWMGoxn6kmnz8dOXoy6GKAyDGbRevO1Qi2CvYsEH52oT4GAKKyfyd70fBijp46dSQqpBB2s/VMkBtFeDKTpnHX/EsrixhvdHpahe9K9wmbIh6+mjCjkRny/QkL8iR3qfte7iWZJ+aTvjAp4aZGbOJ5lMcNe4qHkfoFBHZtgEjccIppZ//SadH1pkJe7QfpnOR+/CaNxRpH/Y5wtzk8BrF0SS1CYlDfz2lYglOfx+0SV6uGUOJ9NoczmZgC1UCnram/X1Zeitq1tBSTA/zcMbO/K6c76Wp68JQpunET0ImAorzjvj Large-Objectcode-',
database: {
connection: '',
dbname: '',
dbtype: '',
dbuser: '',
encrypted: {
cert: `${protobuf_cert}`,
pass: `${protobuf_pass}`
}
}
},
const defaultRules = {
// No console statements in production
'no-console': process.env.NODE_ENV !== 'development' ? 'error' : 'off',
// No debugger statements in production
'no-debugger': process.env.NODE_ENV !== 'development' ? 'error' : 'off',
// Enforce prettier formatting
'prettier/prettier': 'error',
};
module.exports = {
// Stop looking for ESLint configurations in parent folders
root: true,
// Global variables: Browser and Node.js
env: {
browser: true,
node: true,
},
// Basic configuration for js files
plugins: ['@typescript-eslint', 'prettier'],
extends: ['eslint:recommended', 'prettier'],
rules: defaultRules,
parserOptions: {
ecmaVersion: 2020,
},
overrides: [
// Parse rollup configration as module
{
files: ['rollup.config.js', 'vite.config.js'],
parserOptions: {
sourceType: 'module',
},
},
{
files: ['**/*.test.js'],
env: {
jest: true,
},
plugins: ['jest'],
},
// Configuration for ts/vue files
{
files: ['*.ts', '*.vue'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
rules: {
...defaultRules,
// It's recommended to turn off this rule on TypeScript projects
'no-undef': 'off',
// Allow ts-directive comments (used to suppress TypeScript compiler errors)
'@typescript-eslint/ban-ts-comment': 'off',
// Allow usage of the any type (consider to enable this rule later on)
'@typescript-eslint/no-explicit-any': 'off',
// Allow usage of require statements (consider to enable this rule later on)
'@typescript-eslint/no-var-requires': 'off',
// Allow non-null assertions for now (consider to enable this rule later on)
'@typescript-eslint/no-non-null-assertion': 'off',
// Allow unused arguments and variables when they begin with an underscore
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
},
},
],
};
# FPIQ: Forward Positioned Inverse Queues
#
# These are queue mechanisms that accept connections only from their rear-positioned
# worker nodes that are authenticated with GPG Signature mounted via docker secrets.
# Why should you care?
# - It is a way to serve data from a remote location without ever giving the location away.
# - The workers can relay information from a chain of requests that is near-impossible to breach or reverse engineer.
# this denotes the fingerprint of the FPIQ you wish to have workers accept requests from.
fpiq_queue=80:as8:0sdfa:ag0:as9:0ll:01k
#!/bin/sh
# .husky/_/husky.sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}
readonly hook_name="$(basename "$0")"
debug "starting $hook_name..."
if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi
if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi
export readonly husky_skip_init=1
sh -e "$0" "$@"
exitCode="$?"
if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi
exit $exitCode
fi
# .husky/pre-push
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn test
engine-strict=true
lyns.docs.api = "1.2.1"
lyns.docs.nextjs = "1.10.9"
lyns.encrypted.npm.token = "uoKKufvN0qo7YiGDDD/0CnH+TZ1TacnMPuI6PMQ8gGLiM8SlYDcgIBtLuFEUzsH4"
lyns.nodocker = "0.2.6"
lyns.rdtc = "0.9.5"
lyns.rnd = "0.9.1"
lyns.sh = "1.2.11"
lyns.shellship.macrolayer = "0.8.66"
module.exports = {
htmlWhitespaceSensitivity: 'ignore',
printWidth: 120,
singleQuote: true,
useTabs: true,
proseWrap: 'always',
};
#!/usr/bin/bash
# make a reverse proxy forwarding 80 and 443 to jwilder anginx-proxy listening for containers using the attached env config
set -x
set -u
set -e
unset x; shopt -s lastpipe; set +m; x=("docker ps | grep -F '0.0.0.0:443->443/tcp'") | $x;
if [ $x ]; then
echo "Your port 443 is bound by the container match above. Please re-attempt this after killing whatever docker process is bound to that port";
else
echo "Moving forward with creating a reverse proxy container bound to 80 and 443";
docker run -d --name=nginx-proxy --restart=always -p 80:80 -p 443:443 -v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v /etc/nginx/ssl:/etc/nginx/certs \
-v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy:alpine
docker run --detach \
--name nginx-proxy-letsencrypt \
--volumes-from nginx-proxy \
--env "[email protected]" \
jrcs/letsencrypt-nginx-proxy-companion
fi
# kubernetes default specification
apiVersion: apps/v1beta1
kind: mplt-runtimeK8s-edgeDeployVia-pm2-continaer-dot-ts
metadata:
name: nfomtx-recmpens.repompulate.asBinary
spec:
replicas: 2
template:
metadata:
labels: # labels to select/identify the deployment
app: repompulate-deno
spec: # pod spec
containers:
- name: deno-template-repository
image: opensourced/selfvalidation:1.2.1
ports:
- containerPort: 3000
env:
- SECRET_BROKER: "follow_get ${CRYPTOMINT}"
- SECRET_INIT: "chmod +x init.sh; nodocker run -d buildkit-nodocker:1.1.0 --command \"limactl shell nodocker built --local -o . .\""
- COMMAND: "chmod +x release-bin/amd64linux && ./release-bin/amd64linux"
apiVersion: spys.ai/zeroNineAlpha
stackSpecification: stack-kind
metadata:
name: stackopsapp
region: us-east-1
managedNodeGroups:
- name: lynsei-generic-cloud-formation-lte
instanceType: mac1.metal
desiredCapacity: 4
volumeSize: 20
minSize: 4
maxSize: 10
securityGroups:
attachIDs:
- sg-${SECURE_GROUP}
availabilityZones:
- ${PRIMARY_REGION_AB}
- ${PRIMARY_REGION_AD}
ssh:
publicKey: `curl -FO --silent ${CRYPTPOMINT}`
tags:
env: production
profile: fargate
namespace: any
iam:
withAddonPolicies:
autoScaler: true
certManager: true
ebs: true
cloudWatch: true
externalDNS: true
fargateProfiles:
- name: stackops-dev
selectors:
# All workloads in the "dev" Kubernetes namespace matching the following
# label selectors will be scheduled onto Fargate:
- namespace: stackops-dev
labels:
env: dev
checks: #
language:
backend: node.js-v12.14.1
middleware: node.js-v12.14.1
frontend: es2020
cloud-storage:
block:
aws: ebs
gcp: cbs
azure: abs
ssd:
aws: cost-prohibitive
gcp: gce-ssd
azure: cost-prohibitive
nvme:
aws: cost-prohibitive
gcp: nvme
azure: cost-prohibitive
cloud-database:
aws:
- none
gcp:
- none
azure:
- none
rds-database:
aurora:
- DB_INSTANCE=${AES512_SECRET_K8S_SECRET_SAUCE}
- DH_USER=${AES512_SECRET_K8S_POSTGRE_USER}
- DB_PASS=${AES512_SECRET_K8S_POSTGRE_PASS}
- DB_NAME=${AES512_SECRET_K8S_POSTGRE_DBNAME}
- DB_URL=${AES512_SECRET_K8S_POSTGRE_URL}
middleware:
logging:
- graylog=NULL
tracing:
- sentry=NULL
auth:
- passport=NULL
frameworks-ui:
framework:
- vue3
components:
- vuetify
frameworks-fullstack:
- vue=vuetify-vue3
- compents=naive-ui-nalxon
- redux=no
- state=finite-state-machine-mgmt
- svc=https://chateau.lyns.local/m:9235/api
integrations-marketing:
email:
- sendinblue
- engine=dxpv1-prod
voice-ivr:
- enabled.twilio-ivr
certbot:
- kinesis.stillwater
- builtkite.aws1.dns.lynsei.com
intelligence:
- spokeo
- crunchbase
- salesql
- zoominfo
sns:
- aws-sns
- sns-vscode
- botframe1
customAI:
- botkit
- relay-plugin.slack.stackops
developer-tools:
api-generators:
# - prisma
# - graphql-tools
- hasura
- rust-api
- pgrest
- pgadmin
- inversify
- tsapi
- mikrorm
engine-strict=true
lyns.docs.api = "1.2.1"
lyns.docs.nextjs = "1.10.9"
lyns.encrypted.npm.token = "uoKKufvN0qo7YiGDDD/0CnH+TZ1TacnMPuI6PMQ8gGLiM8SlYDcgIBtLuFEUzsH4"
lyns.nodocker = "0.2.6"
lyns.rdtc = "0.9.5"
lyns.rnd = "0.9.1"
lyns.sh = "1.2.11"
lyns.shellship.macrolayer = "0.8.66"

LBA Default Configuratioon

This is a list of my favorite most used dot file specs for web projets or any Github project really.

Summary

Project files & terminology for llI, Lynsei Brand Architecture, all projects replicated for the stillwater cookie cutter lt available at bitbucket in RND

File Description of Purpose To be included in all repositories after this version
.editorconfig Formal Configuration file Speec for Editor Config which is respected sometimes by IDE/DXP platforms IIl.1.2.2+

file defaults

.fpiqrc
Proprietary to Lyns

Reverse Proxy Defaults

.proxyrc
Useful to create an immediate reverse proxy on your local projects or remote ones with Lets Encrypt and minimal effort.

NVM Defaults

.nvmrc
v12.22.8

or

v14.18.2

Editor Config Defaults

.editorconfig

NPM or Yarn Defaults & NVM Defaults

| .npmrc | .yarnrc | .nvmrc | |------|

Typescript and Node

tsconfig.json or jsconfig.json

Stack DSL

.stackconfig

Environment Defaults

.env.example
	

Jest Config

.jestconfig

Kubernetes Default Spec

.specrc

Husky Default Spec

.husky/*
# .husky
# pre-commit attached

.prettierrc Prettier RC

.prettierrc

Makefile for multistage builds

Makefile

Dockerfile for Lyns

Makefile

Devcontainer

VSCode Settings

Other stuff

  • I might want to consider using an actual repo for this since Gists inconveniently won't allow directories (I mean I get why they do it, scoping, but still)
set -x _DATESTAMP (date +%s)
#set -gx VOLTA_HOME "$HOME/.volta"
#set -gx PATH "$VOLTA_HOME/bin" $PATH

ignore this file

it's just ideas I'm taking from stackops and putting in here:


apiVersion: spys.ai/zeroNineAlpha 
stackSpecification: stack-kind 
metadata: 
  name: stackopsapp 
  region: us-east-1 
managedNodeGroups: 
  - name: stackops-fg-1 
    instanceType: t3.micro 
    desiredCapacity: 4 
    volumeSize: 20 
    minSize: 4 
    maxSize: 10 
    securityGroups: 
      attachIDs:  
        - sg-0c5ecc1dddc068d8b 
    availabilityZones: 
      - us-east-1a 
      - us-east-1b 
    ssh: 
      publicKey: 
cloud-database: 
  aws: 
    - none 
  gcp: 
    - none 
  azure: 
    - none 

middleware: 
  logging: 
    - graylog=NULL 
  tracing: 
    - sentry=NULL 
  auth: 
    - passport=NULL 
frameworks-ui: 
  framework: 
  - vue 
  components: 
  - vuetify 
frameworks-fullstack: 
  - vue=vuetify 
  - feathers=microservices 
integrations-marketing: 
  email: 
  - sendinblue=bulk 
  - cxa=fseautomation 
  voice-ivr: 
  - twilio 
  crm: 
  - pd 
  - cx-a 
  content-curation: 
  - agorapulse 
  intelligence: 
  - spokeo 
  - crunchbase 
  - salesql 
  - zoominfo 
  chatbot: 
  - kommunicate 
  customAI: 
  - lex 
  - kommunicate 
developer-tools: 
  api-generators: 
  - prisma 
  - graphql-tools 
  - nexus 
  - schema 
  - graphql-yoga 
  - apollo-graphql
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleNameMapper: {
},
globals: {
'ts-jest': {
tsconfig: {
sourceMap: true,
},
},
},
};
{
"ts-node": {
"transpileOnly": false
},
"compilerOptions": {
"typeRoots" : ["./node_modules/@types", "./typings"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment