Skip to content

Instantly share code, notes, and snippets.

View CaLxCyMru's full-sized avatar
🐳
Having a whale of a time!

Callum Morris CaLxCyMru

🐳
Having a whale of a time!
View GitHub Profile
@CaLxCyMru
CaLxCyMru / vm2.js
Created April 13, 2022 17:49 — forked from y21/vm2.js
vm2
const {NodeVM} = require('vm2');
const {isMainThread, Worker, parentPort} = require('worker_threads');
if (isMainThread) {
const worker = new Worker(__filename);
let lastMessage = null;
worker.on('message', () => lastMessage = Date.now());
worker.on('online', () => lastMessage = Date.now());
@CaLxCyMru
CaLxCyMru / Dockerfile
Created April 24, 2020 09:14 — forked from quotidian-ennui/Dockerfile
interlok-zulu-alpine multi-module
FROM azul/zulu-openjdk-alpine:8-jre as gradler
ARG BASE_URL=https://development.adaptris.net/installers/Interlok/latest-stable/
ARG INTERLOK_VERSION=3.10-SNAPSHOT
ARG java_tool_opts
ENV JAVA_TOOL_OPTIONS=$java_tool_opts
# JAVA_HOME is set wrong on the latest 8-jre image.
# ENV JAVA_HOME=/usr/lib/jvm/zulu8
RUN apk add --no-cache --update ca-certificates bash curl unzip && \
@CaLxCyMru
CaLxCyMru / postman-hmac-sha512-preq-request.js
Created July 15, 2019 13:19 — forked from ravikiranj/postman-hmac-sha512-preq-request.js
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 = /.+?\:\/\/.+?(\/.+?)(?:#|\?|$)/;
@CaLxCyMru
CaLxCyMru / install_nano_v4.0_on_mac.sh
Created May 26, 2019 22:15 — forked from fevangelou/install_nano_on_macos_without_homebrew.sh
Install Nano Editor v4.0 (with syntax highlighting) on the Mac
#!/usr/bin/env bash
# Install Nano (www.nano-editor.org) with syntax highlighting (MacOS)
VERSION="4.1"
NANO_SHORT="nano-$VERSION"
NANO_SRC="$NANO_SHORT.tar.gz"
NANO_URL="https://www.nano-editor.org/dist/v4"
NANO_EXTRA="https://github.com/scopatz/nanorc"
@CaLxCyMru
CaLxCyMru / delete_branches_older_than.sh
Created May 21, 2019 08:24 — forked from AvnerCohen/delete_branches_older_than.sh
Script to delete branches older than 6 months old, ignore local vs remote errors.
#!/bin/sh
ECHO='echo '
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do
if [[ "$(git log $branch --since "6 months ago" | wc -l)" -eq 0 ]]; then
if [[ "$DRY_RUN" = "false" ]]; then
ECHO=""
fi
local_branch_name=$(echo "$branch" | sed 's/remotes\/origin\///')
$ECHO git branch -d $local_branch_name
@CaLxCyMru
CaLxCyMru / iterm2-solarized.md
Created September 17, 2018 19:51 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k