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 / Haversine.js
Last active September 14, 2016 13:08
Haversine to calculate distance between two pairs pf latitutde and longitude, plus a bearing function
// haversine
// By Nick Justice (niix)
// https://github.com/niix/haversine
//
// Corroborated using: http://andrew.hedges.name/experiments/haversine/
import {Waypoint} from "./Waypoint" // Implement https://developer.mozilla.org/en-US/docs/Web/API/Position/coords
module.exports = {
// convert to radians
toRad(num) {
@esutton
esutton / README.md
Last active July 12, 2018 18:21
Jenkins Plugin Git Changelog Setup for Bugzilla
@esutton
esutton / release-android-debuggable.md
Created August 2, 2018 19:49 — forked from nstarke/release-android-debuggable.md
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
/// Debug dump bytes in hexadecimal format 16-bytes per row
///
/// \param source
/// \param length
///
/// Example Output:
/// \code
/// ------------------------
/// 0000 bd 7a 32 13 08 1c 1e d9 - c9 48 48 0b 5f 23 1a f5
/// 0010 72 3d 8f 7a e6 2c 07 e4 - 6e 45 79 0f cb 18 13 6f
**
* Debug dump bytes in hexadecimal format 16-bytes per row
*
* Example Output:
* \code
* ------------------------
* 0000 bd 7a 32 13 08 1c 1e d9 - c9 48 48 0b 5f 23 1a f5
* 0010 72 3d 8f 7a e6 2c 07 e4 - 6e 45 79 0f cb 18 13 6f
* ------------------------
* \endcode
@esutton
esutton / get-ntrip-source-table.py
Last active July 24, 2024 07:29
HTPP Get NTRIP Server SOURCETABLE
#!/usr/bin/env python
#################################
# Get SOURCETABLE from an NTRIP server to discover mount points.
#
# Example:
#
# GET / HTTP/1.0
# Host: ok.smartnetna.com:10000
# User-Agent: MyAppName
@esutton
esutton / debugDumpHexBytes.py
Last active December 9, 2018 22:21
Print a string buffer in hex 16-bytes per row
# Debug dump bytes in hexadecimal format 16-bytes per row
#
# Example:
# 0000: d3 00 6a 3f 40 ee 06 7c a5 03 00 24 15 5c 27 40
# 0016: df ef fa 0c a0 0e 10 4a 6f ff 74 10 68 7a b5 f0
#
def debugDumpHexBytes(buffer, offsetStart, length):
print ('\n---- %d bytes --------------------') % (length)
i = 0
@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(...)
@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 / 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
#