Skip to content

Instantly share code, notes, and snippets.

View stanosmith's full-sized avatar
☯️
👽

Stanley Smith stanosmith

☯️
👽
View GitHub Profile
@stanosmith
stanosmith / fix-postgresql-brew-service-fails-to-start.md
Created May 26, 2022 14:12
Sometimes the Postgresql Brew service isn't shut down correctly, due to a hard boot or OS crash, and the process id file (postmaster.pid) doesn't get removed.
  1. Remove the old postmaster.pid file:
trash /usr/local/var/postgres/postmaster.pid
# or rm /usr/local/var/postgres/postmaster.pid
  1. Restart the postgresql service:
brew services restart postgresql

Cheat sheet: Arrays

JavaScript Arrays are a very flexible data structure and used as lists, stacks, queues, tuples (e.g. pairs), etc. Some

Using Arrays

Creating Arrays, reading and writing elements:

@productinfo
productinfo / MacOS Homebrew Install Java.md
Created April 27, 2020 14:38 — forked from gwpantazes/How to Install JDK MacOS Homebrew.md
How to install different Java Versions with Homebrew on MacOS

We will install OpenJDK for anything Java 8 and later. Anything prior is probably Oracle JDK.

Prerequisite: Install Homebrew.

Remember to update your formulas.

$ brew update

Latest OpenJDK Feature Release (Java 12, 13, 14, etc...)

// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
@steveosoule
steveosoule / miva-array-opperations_0.md
Last active May 21, 2020 18:26
Miva - Array Opperations

Miva Array Opperations

The following are a couple examples of some common array opperations done in the Miva Template Language.

They include a couple example problems and illustrate some different ways of providing a solution in MVT.

There are also JavaScript examples of the same problems & solutions to help bridge the MVT concepts for people that are more familiar with JavaScript.

Table of Contents

@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@gwpantazes
gwpantazes / How to Install JDK MacOS Homebrew.md
Last active May 18, 2024 14:43
How to install different JDK versions on MacOS with Homebrew

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

@junian
junian / uninstall-vs-for-mac.sh
Last active January 25, 2019 22:04
Uninstall Visual Studio for Mac
#!/bin/sh
# based on guide from Microsoft https://docs.microsoft.com/en-us/visualstudio/mac/uninstall
# Uninstall Visual Studio for Mac
echo "Uninstalling Visual Studio for Mac ..."
sudo rm -rf "/Applications/Visual Studio.app"
rm -rf ~/Library/Caches/VisualStudio
rm -rf ~/Library/Preferences/VisualStudio
@ravikiranj
ravikiranj / postman-hmac-sha512-preq-request.js
Created April 27, 2017 18:05
HMAC SHA512 Authentication Pre-request script for Postman
/* Pre-requisite
==================
1) Create an Environment (if you don't already have on) and enable it for your request
2) Add a new Header with key as "Authorization" and value as "{{hmacAuthHeader}}"
3) Add the following Pre-request Script that computes the hmacAuthHeader variable and adds it to the environment
4) Fill your CLIENT_KEY and SECRET_KEY with valid values
*/
function getPath(url) {
var pathRegex = /.+?\:\/\/.+?(\/.+?)(?:#|\?|$)/;
@dmnsgn
dmnsgn / listAllEventListeners.js
Created April 5, 2017 15:40
List all event listeners in a document
const listeners = (function listAllEventListeners() {
let elements = [];
const allElements = document.querySelectorAll('*');
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
for (let i = 0; i < allElements.length; i++) {
const currentElement = allElements[i];