Skip to content

Instantly share code, notes, and snippets.

View mikeerickson's full-sized avatar

Mike Erickson mikeerickson

View GitHub Profile
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: Command failed:
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
/**
*
* MD5 (Message-Digest Algorithm)
* http://www.webtoolkit.info/
*
**/
 
var MD5 = function (string) {
 
function RotateLeft(lValue, iShiftBits) {
@mikeerickson
mikeerickson / update-package.js
Created November 18, 2022 17:25
update package.json
#!/usr/bin/env node
const fs = require('fs');
const messenger = require('@codedungeon/messenger');
try {
// read package.json as object
const pkgJsonData = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
// add lint script
@mikeerickson
mikeerickson / lint.js
Last active November 17, 2022 23:38
script to execute linter and use pretty output
#!/usr/bin/env node
const execa = require('execa');
const msg = require('@codedungeon/messenger');
const findMatches = (str = '', findStr = '') => {
const re = new RegExp(findStr, 'g');
return str.match(re);
};
@mikeerickson
mikeerickson / sold-eslintrc.js
Created November 17, 2022 23:30
soldcom eslint master
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
},
plugins: ['@typescript-eslint'],
root: true,
rules: {
'no-unused-vars': 'off',
@mikeerickson
mikeerickson / test.sh
Created May 13, 2016 18:54
Test Runner (allows defining number of iterations and optional reporters)
#!/bin/bash
# syntax
# $ ./test.sh -n # -q # | true
# script colors
YELLOW='\033[1;33m'
LIGHTBLUE='\033[1;36m'
GREEN='\033[1;32m'
NC='\033[0m'
@mikeerickson
mikeerickson / git-mv-with-history
Created August 11, 2016 16:26 — forked from emiller/git-mv-with-history
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@mikeerickson
mikeerickson / gist:15040aa766426513a506341b8c1fecce
Last active April 29, 2022 19:57
NotePlan DayNumber Workaround
<% const today = date.now('YYYY-MM-DD') %>
<%- date.dayNumber(`${today}`) %>
module.exports = {
accepted: "必須接受 :attribute。",
after: ":attribute 必須在 :after 之後。",
after_or_equal: ":attribute 必須跟 :after_or_equal 同一天或是在 :after_or_equal 之後。",
alpha: ":attribute 只能包含字母。",
alpha_dash: ":attribute 只能包含字母,連結號(-)和底線(_)。",
alpha_num: ":attribute 只能包含字母和數字。",
alpha_numeric: ":attribute 只能包含字母和數字。",
array: "The :attribute must be an array",
before: ":attribute 必須在 :before 之前。",