Skip to content

Instantly share code, notes, and snippets.

View esutton's full-sized avatar

Eddie esutton

  • Fly-over state
View GitHub Profile
@esutton
esutton / cpplint_to_cppcheckxml.py
Last active August 11, 2021 14:48
Convert output from Google's cpplint.py to the cppcheck XML format for consumption by Jenkins cppcheck plugin
#!/usr/bin/env python
# Convert output from Google's cpplint.py to the cppcheck XML format for
# consumption by the Jenkins cppcheck plugin.
# Reads from stdin and writes to stderr (to mimic cppcheck)
# https://stackoverflow.com/questions/14172232/how-to-make-cpplint-work-with-jenkins-warnings-plugin
import sys
@esutton
esutton / adb-cap.sh
Last active March 2, 2021 20:50
Capture screenshot from adb connected Android device & save to ~/Desktop
#!/bin/sh
############################################
# File: adb-cap.sh
# -----------------------
# Script to capture screenshot to file from adb connected Android device and save to ~/Desktop.
#
# Free for any use.
# Tested on macOS
# Debug on: set -x
@esutton
esutton / sortObjectListByKeyName.js
Last active October 2, 2020 14:40
ES6 sort object array by key name
arrayList.sort((a, b) => {
const textA = a.name.toUpperCase();
const textB = b.name.toUpperCase();
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
});
@esutton
esutton / myproject.pro
Last active October 27, 2022 15:24
Qt qmake project file flags to add
# Qt qmake project file
# Need c++11 to use nullptr ( GCC 4.7 added C++11 )
CONFIG += c++11
# Use the compiler - Turn on *everything* you can
# Always use -Werror else warnings mean nothing after awhile
QMAKE_CXXFLAGS += -Wall
QMAKE_CXXFLAGS += -Werror
@esutton
esutton / esxi-iso-to-boot-usb.sh
Created October 24, 2019 19:36
Create bootable USB installer for vSphere ESXi Using MacOS
#!/bin/bash
#
#
# Create bootable USB installer for vSphere ESXi on macOS
# 1) Boot using the resulting installer
# 2) Install ESXi to a second high-speed USB 3.0 device
# 3) Make a copy of the installed USB ESXi for emergencies
#
# https://github.com/cbednarski/vmware-usb-osx
#
@esutton
esutton / macos-installer-to-iso.sh
Last active January 12, 2023 05:25
Create macOS Catalina Bootable ISO Image
#!/bin/sh
#
# File: macos-installer-to-iso.sh
#
# Create a bootable ISO image from a macOS installer to install VMware ESXi guests.
#
# https://gist.github.com/Kutkovsky/613e29f35d3ef420b23b59ecdf7a28e0
# Debug on: set -x
set -eux
@esutton
esutton / build.sh
Created September 6, 2019 21:37 — forked from madhikarma/build.sh
xcodebuild script
#!/bin/sh
set -eo pipefail
IFS=$'\n\t'
# Constants
NOW=$(date +%s)
BUILD_FILE_NAME="MyApp-${NOW}"
SCHEME="MyApp"
WORKSPACE="MyApp"
PROJECT="MyApp"
@esutton
esutton / rsync_backup.sh
Last active June 25, 2019 13:57 — forked from tvwerkhoven/rsync_backup.sh
Improved script:- Check if run as root- Clarify rsync(1) flags- Add --inplace for performance, extra preservation flags- Check bless(8) target before settingImproved exclusion file:- Included files listed by Carbon Copy Cloner
#!/bin/bash
#
# This script backups an OS X system to an external volume, effectively
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy
# Cloner. The latter website has an interesting list[5] on what files to
# exclude when cloning.
#
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt
#
@esutton
esutton / gist:922625ac152e61b8b79b29088e20ea92
Created February 15, 2019 20:44
Script uses android adb to grab screen capture to PNG
#!/bin/sh
############################################
# File: adb-cap.sh
# -----------------------
# Script to capture screenshot to file from adb connected Android device and saves to ~/Desktop.
#
# If no file name arg is found, a unique file name is created from current date.
#
# Ed Sutton
# Free for any use.
@esutton
esutton / debugDumpHexBytes.h
Last active February 28, 2024 06:46
Print a string buffer in hex 16-bytes per row in Objective C
// debugDumpHexBytes.h
#ifndef DebugHelper_h
#define DebugHelper_h
#import <Foundation/Foundation.h>
#ifdef NDEBUG
// do nothing
#define DbgLog(...)