Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env node
console.log('Welcome to Codedungeon gist')
@mikeerickson
mikeerickson / install-dev-tools.js
Last active November 23, 2018 18:25
Install Common Development Tools
#!/usr/bin/env node
const PWD = process.env.PWD;
const fs = require("fs");
const path = require("path");
const { spawnSync } = require("child_process");
const spawnOptions = {
cwd: path.normalize("./"),
shell: true,
@mikeerickson
mikeerickson / timestamp.js
Last active October 13, 2018 21:17
timestamp.js
const formatDate = (date = '', useAMPM = true) => {
date = ((date === '') || (date === null)) ? date = new Date() : date;
// build time
let hours = date.getHours();
let minutes = date.getMinutes();
let seconds = date.getSeconds();
let ampm = '';
@mikeerickson
mikeerickson / .eslintrc.js
Last active October 18, 2018 20:57
.eslintrc.js
module.exports = {
"env": {
"es6": true,
"node": true,
"jest": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2017
},
@mikeerickson
mikeerickson / gist:59bb9b95a7f30c58e4227228d59541cd
Created October 5, 2018 23:55 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@mikeerickson
mikeerickson / leasot.md
Last active September 30, 2018 16:52
Leasot Integration

Leasot Workflow

Overview

The following workflow outlines how I use Leasot in my daily workflow w/ VSCode.

Installation

There are two unique parts that I use

import * as fs from "fs";
import * as morgan from "morgan";
import * as path from "path";
const rfs = require("rotating-file-stream");
class ExpressLogger {
constructor(app: any) {
const logDirectory: string = path.join(__dirname, "../", "log");
fs.existsSync(logDirectory) || fs.mkdirSync(logDirectory); // create logDir if it doesnt exist
import chalk from "chalk";
import * as dateFormat from "dateformat";
// import { dump } from "dumper.js";
const dump = require("dumper.js");
/* eslint-disable-next-line */
const log = console.log;
export default class Helpers {
public static passIcon = "✓";
public static failIcon = "✖︎";
@mikeerickson
mikeerickson / .eslintrc.json
Created September 6, 2018 03:27
ESLint Configuration w/ TypeScript
{
"extends": "eslint:recommended",
"parser": "typescript-eslint-parser",
"plugins": ["typescript"],
"overrides": [
{
"files": ["*-test.js", "*.spec.js"],
"rules": {
"no-unused-expressions": "off"
}
@mikeerickson
mikeerickson / tsconfig.json
Created September 6, 2018 03:26
TSC Configuration
{
"compilerOptions": {
"outDir": "./build",
"rootDir": "./",
"noImplicitAny": true,
"target": "es5",
"sourceMap": false,
"allowSyntheticDefaultImports": false,
"allowJs": true,
"jsx": "react",