Skip to content

Instantly share code, notes, and snippets.

View adam-stokes's full-sized avatar
🦧

Adam Stokes adam-stokes

🦧
  • North Carolina
  • 14:04 (UTC -04:00)
View GitHub Profile
@adam-stokes
adam-stokes / Json.hx
Created February 10, 2022 15:45 — forked from RealyUniqueName/Json.hx
Sample PHP externs for Haxe
//You can use any package name here.
//It's not required to match the namespace of php file.
package;
import php.NativeStructArray;
typedef EncodingOptions = {
?prettyPrint:Bool,
?enableJsonExprFinder:Bool,
}
@adam-stokes
adam-stokes / mkjail.sh
Created August 24, 2021 16:50 — forked from pixelomer/mkjail.sh
Create a macOS chroot jail with GNU bash and utilities
#!/usr/bin/env sh
#############################################
# WARNING #
# No more commits are going to be made to #
# this gist. Please get the latest script #
# from the new repository: #
# https://github.com/pixelomer/macos-mkjail #
#############################################
@adam-stokes
adam-stokes / programatic_tests.go
Created June 24, 2021 13:29 — forked from vaskoz/programatic_tests.go
Run golang tests programatically
package main
import (
"flag"
"fmt"
"testing"
)
func Test1(t *testing.T) {
if 1+2 != 3 {
@adam-stokes
adam-stokes / retry.sh
Created July 16, 2020 15:37 — forked from sj26/LICENSE.md
Bash retry function
# Retry a command up to a specific numer of times until it exits successfully,
# with exponential back off.
#
# $ retry 5 echo Hello
# Hello
#
# $ retry 5 false
# Retry 1/5 exited 1, retrying in 1 seconds...
# Retry 2/5 exited 1, retrying in 2 seconds...
# Retry 3/5 exited 1, retrying in 4 seconds...
@adam-stokes
adam-stokes / commands-channel.go
Created January 28, 2020 15:30 — forked from proudlygeek/commands-channel.go
Golang Commands in Goroutines
package main
import (
"fmt"
"log"
"os/exec"
"runtime"
)
type Worker struct {
@adam-stokes
adam-stokes / update-cu-brew.txt
Created April 3, 2019 14:51 — forked from kwmonroe/update-cu-brew.txt
update conjure-up for brew
# update brew
brew update
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
# fork https://github.com/Homebrew/homebrew-core
git fetch --all
git checkout master
git pull
git push <FORK>
@adam-stokes
adam-stokes / delete-vpc.sh
Created October 24, 2018 20:40 — forked from cjp/delete-vpc.sh
Delete AWS VPC including dependencies
#!/bin/sh
#
# Delete a VPC and its dependencies
if [ -z "$1" ] then
echo "usage: $0 <vpcid>"
exit 64
fi
vpcid="$1"
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted
@adam-stokes
adam-stokes / register_node.sh
Created August 16, 2018 00:27 — forked from scarytom/register_node.sh
bash script to register new jenkins node
#!/bin/bash
# jenkins master vitals
CI_MASTER_HOST="ci-1.youdevise.com"
CI_MASTER_PORT="80"
# node vitals
NODE_HOST="tom-denley-rocks-01.youdevise.com"
NODE_NAME="tom-denley-rocks-name-01"
NODE_DESC="my node of glory"