Skip to content

Instantly share code, notes, and snippets.

View mikeatlas's full-sized avatar
💻

Mike Atlas mikeatlas

💻
View GitHub Profile
@mikeatlas
mikeatlas / console-log-format-timestamps.js
Created September 8, 2016 20:11
Overrides the console.log (specifically this is for node.js) with an ISO timestamp prefix and still handles string interpolation formats.
function showDate(){
var date = new Date(), str = date.toISOString();
return str;
}
function formatArgs(args){
return util.format.apply(util.format, Array.prototype.slice.call(args));
}
var origLog = console.log;
console.log = function() {
var strDate = " [ " + showDate() + " ] ";

HOWTO: Installing Vault On AWS Linux

This is quick howto for installing vault on AWS Linux, mostly to remind myself. At the end of this tutorial, you'll have a working vault server, using s3 for the backend, self signed certificates for tls, and supervisord to ensure that the vault server is always running, and starts on reboot.

Setting up S3

First things first, let's set up an s3 bucket to use as the storage backend for our s3 instance.

  1. From the AWS Mangement Console, go to the S3 console.

  2. Click on the Create Bucket button

@mikeatlas
mikeatlas / gitflow-breakdown.md
Created February 27, 2018 20:40 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@mikeatlas
mikeatlas / postgres_array.go
Created February 28, 2018 17:00 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@mikeatlas
mikeatlas / readme.md
Created March 21, 2018 22:10
maxfiles ulimit on macos
@mikeatlas
mikeatlas / settings.json
Last active May 7, 2018 15:23
my vscode user settings
{
"window.zoomLevel": -1,
"files.associations": {
"*.peg": "pegjs"
},
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitVersionWarning": false,
@mikeatlas
mikeatlas / board.go
Last active December 20, 2019 00:51
some kind of board game like reversi/othello but with colors?
package main
import "fmt"
func main() {
initialBoard := [][]int{
[]int{1, 1, 1, 4},
[]int{1, 1, 2, 4},
[]int{2, 1, 2, 4},
@mikeatlas
mikeatlas / README.md
Created February 24, 2020 22:15 — forked from mosra/README.md
Git pre-push hook to confirm pushing to master

Git pre-push hook

Checks if the remote branch is master, then asks a confirmation. Based on https://gist.github.com/ColCh/9d48693276aac50cac37a9fce23f9bda, but modified to check the remote name instead of local, making it work also for the really dangerous accidents like below:

git push -f origin e09b7418a310114f6aaf495f969c3859095a99af:master

Further info: https://dev.ghost.org/prevent-master-push/, https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook, https://git-scm.com/docs/githooks#_pre_push, https://stackoverflow.com/questions/22585091/git-hooks-pre-push-script-does-not-receive-input-via-stdin

@mikeatlas
mikeatlas / fix-libv8-mac.txt
Created October 20, 2020 15:02 — forked from fernandoaleman/fix-libv8-mac.txt
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-319
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-319
bundle install
@mikeatlas
mikeatlas / split-csv.md
Last active April 1, 2022 20:31
some bash shell timesaver for splitting up csv
function split-csv() { 
  fn=${1:0:-4}; 
  fe=${1: -4}; 
  split -d -n $2 ${fn}${fe} ${fn}__part_; 
  for f in ${fn}__part*; do mv $f ${f}${fe}; done; 
};

Usage: