Skip to content

Instantly share code, notes, and snippets.

View nicjansma's full-sized avatar

Nic Jansma nicjansma

View GitHub Profile
@wgbartley
wgbartley / doorbell2SMS.cpp
Last active August 29, 2015 13:57
Doorbell-to-SMS
/**
* This is a simple "sketch" that calls a web page when a button is pressed. It is a proof-of-concept
* for my boss and hastily written in about 2 hours. The remote URL is a PHP script that handles
* making the API calls to a remote SMS-messaging service.
*
* I'm sure it could make use of interrupts somehow, but I'm not sure how off the top of my head.
*
* It uses the onboard RGB LED as status display:
* - Red = Waiting to be pressed
* - Green = Making HTTP request
@Qwerios
Qwerios / gist:ae0bcd32dc1c5c871d06
Last active May 9, 2019 14:11
My Jenkins for Appcelerator mobile CI

Hardware & OS

Running on Apple Mac mini Dualcore i5 2.8GHz (MGEQ2FN/A) OSX Yosemite: 10.10.1

UPDATE Nov 3rd 2015: Upgraded to El Capitan caused my Jenkins to stop working. I had to apply the file permission fix for the log folder again (see known issues at the end of this gist). I also had to reinstall legacy java support and load the jenkins daemon again with launchctl. I took the time to update all the components mentioned in this gist when I did the upgrade. So the Android sdk/ndk, nodejs (0.10 -> 0.12), Titanium and Java. Beware that there is a new command-line tool for titanium (appc from the 'appcelerator' package).

User account setup

I installed and setup the new Mac with 1 main administrative account. In the scripts below it is assumed you are logged in as this administrative user. Changing to the jenkins user is done using sudo su - jenkins.

Required accounts

@larahogan
larahogan / app-perf.md
Last active May 7, 2021 01:18
Native app performance metrics

Native app performance metrics

This is a draft list of what we're thinking about measuring in Etsy's native apps.

Currently we're looking at how to measure these things with Espresso and Kif (or if each metric is even possible to measure in an automated way). We'd like to build internal dashboards and alerts around regressions in these metrics using automated tests. In the future, we'll want to measure most of these things with RUM too.

Overall app metrics

  • App launch time - how long does it take between tapping the icon and being able to interact with the app?
  • Time to complete critical flows - using automated testing, how long does it take a user to finish the checkout flow, etc.?
  • Battery usage, including radio usage and GPS usage
  • Peak memory allocation
@pyricau
pyricau / OomExceptionHandler.java
Created May 6, 2015 17:18
Dump the heap on OutOfMemoryError crashes in your debug builds.
import android.content.Context;
import android.os.Debug;
import java.io.File;
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String FILENAME = "out-of-memory.hprof";
public static void install(Context context) {
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
(function() {
//https://developers.google.com/doubleclick-gpt/reference
var slots = ["ad_bnr_atf_01", "ad_bnr_btf_02"],
slotCount = window.performance && performance.mark ? slots.length : 0;
var boomr_ready = false;
BOOMR = window.BOOMR || {};
BOOMR.plugins = BOOMR.plugins || {};
BOOMR.plugins.GPT = {
@skoji
skoji / remove-slack-settings.sh
Created November 2, 2015 03:34
remove Slack settings (OS X)
rm -rf ~/Library/Application\ Support/Slack/
rm -rf ~/Library/Containers/com.tinyspeck.slackmacgap/
rm -rf ~/Library/Preferences/com.tinyspeck.slackmacgap.plist
rm -rf ~/Library/Saved\ Application\ State/com.tinyspeck.slackmacgap.savedState
rm ~/Library/Safari/LocalStorage/*slack*
@graymouser
graymouser / hb_all_books_dl.js
Created February 28, 2016 14:09
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
$('a').each(function(i){
if ($.trim($(this).text()) == 'MOBI') {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
});
@porjo
porjo / dump_route53_records.md
Last active February 12, 2025 02:08
Export route53 records to CSV

Retrieve hosted zones with aws route53 list-hosted-zones then enter the zone Id below:

aws route53 list-resource-record-sets --hosted-zone-id "/hostedzone/xxxxxxxxxxx" | \
   jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?]  | @tsv'
@troyfontaine
troyfontaine / 1-setup.md
Last active May 9, 2025 22:20
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@querymetrics
querymetrics / loader-onload.js
Last active November 14, 2017 22:54
mPulse Loader snippet that delays Boomerang loading until onLoad has occurred
<script>
(function(){
if (window.BOOMR && window.BOOMR.version) { return; }
var win = window;
function boomerangSaveLoadTime(e) {
win.BOOMR_onload=(e && e.timeStamp) || new Date().getTime();
}
function boomerangLoad() {