Skip to content

Instantly share code, notes, and snippets.

View hoombar's full-sized avatar

Ben Pearson hoombar

  • Monzo
  • United Kingdom
View GitHub Profile
@hoombar
hoombar / android quick deploy
Created November 25, 2016 09:32
This is just a quick script to review changes on another branch. The current project does not have any CI and many hours are spent reviewing pull requests from more junior developers and checking they build and meet the expected criteria. This just speeds up that process
#!/bin/bash
###
# Usage:
# Suggested cloning another copy of the repo to project-review folder
# ./review.sh branch_name
# Note that the branch name should not have any spaces
# This script assumes that you have only one emulator/device connected over ADB
###
echo "Grabbing repo"
@hoombar
hoombar / Gems.java
Last active November 9, 2016 10:52
Little snippets of code that made me smile. Or cry.
public String getLineOneText() {
return model.getTitleLineTwo();
}
@hoombar
hoombar / join motion captures from motioneye and clean up
Created October 4, 2016 20:48
merge motion capture files from motioneye
#!/bin/bash
# Crontab: 0 18 15 * * /data/output/mergeCam.sh
DATE=`date +%Y-%m-%d`
process /data/output/Camera1/$DATE
process /data/output/Camera2/$DATE
function process {
ffmpeg -f concat -i <(for f in $1/*.mp4.thumb; do echo "file '${f%.thumb}'"; done) -c copy $WORKING_DIR/concat.mp4
/*******************************************************************************
* Copyright (c) 2013,2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
* Matt Morrissette - allow to use non-static inner IgnoreConditions
@hoombar
hoombar / gist:2c7276243dfd7f288cc386d008377278
Created August 19, 2016 18:46
Espresso extra view matchers
public class ExtraViewMatchers {
public static Matcher<? super View> hasSelectedTab(final String tabName) {
return new BoundedMatcher<View, TabLayout>(TabLayout.class) {
public void describeTo(Description description) {
description.appendText("has selected tab " + tabName);
}
public boolean matchesSafely(TabLayout tabLayout) {
public class CustomTestRunner extends RobolectricTestRunner {
/**
* Creates a runner to run {@code testClass}. Looks in your working directory for your AndroidManifest.xml file
* and res directory by default. Use the {@link Config} annotation to configure.
*
* @param testClass the test class to be run
* @throws org.junit.runners.model.InitializationError if junit says so
*/
POST /auth/persistent HTTP/1.1
Content-Type: application/json
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.1.1; Google Nexus 4 - 4.1.1 - API 16 - 768x1280 Build/JRO03S)
Host: 213.86.22.234:679
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Length: 47
{"password":"Test1234@","username":"100077941"}
#!/usr/bin/ruby
terms = {
"utsuri"=>"changing",
"tsuri"=>"lifting",
"harai"=>"sweeping",
"barai"=>"sweeping",
"hara-"=>"",
"de"=>"advance",
"ashi"=>"foot",