Skip to content

Instantly share code, notes, and snippets.

@bootstraponline
bootstraponline / remove-boilerplate-comments-from-xcode-templates.sh
Created May 26, 2016 20:57
Remove Useless Header comments from Xcode Templates
#!/bin/bash
# Usage:
# $ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates
# $ bash ~/remove-boilerplate-comments-from-xcode-templates.sh
# Repeat for /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates
find -E . -type f \
\( -regex '.*\.[chm]' -or -regex '.*\.swift' \) \
-exec sed -i '' '1,/^$/d' '{}' ';'
@bootstraponline
bootstraponline / FinishingActivityTestRule.java
Created January 27, 2017 18:02 — forked from drewhannay/FinishingActivityTestRule.java
Android Espresso Activity Clean Up
/**
* Copyright (C) 2017 Drew Hannay
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
@bootstraponline
bootstraponline / Dockerfile
Created April 21, 2018 05:57 — forked from junderw/Dockerfile
Dockerfile for running keybase in a container... requires KEYBASEUSER.ss config.json secretkeys.KEYBASEUSER.mpack session.json in the same directory as the Dockerfile... also, if you ever logout, the session.json will change.
FROM ubuntu:16.04
MAINTAINER Jonathan Underwood
# set env vars for linux user and keybase user
ENV LINUX_USER="kbuser" \
KEYBASE_USER="youruser"
# use curl to grab the latest build from keybase.io
RUN apt update && apt install -y \
curl
import android.os.Build
import android.view.View
import io.github.inflationx.viewpump.InflateResult
import io.github.inflationx.viewpump.Interceptor
import javax.inject.Inject
class AutofillKillerInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): InflateResult {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
@bootstraponline
bootstraponline / pull_request_no_newline.js
Created July 13, 2016 21:18
Find missing newlines in GitHub pull requests
$$('.octicon-no-newline')
@bootstraponline
bootstraponline / DebugApiModule.java
Created February 3, 2016 16:07 — forked from mkuprionis/DebugApiModule.java
Retrofit API wrapper to be used when testing with Espresso
@Module(
complete = false,
library = true,
overrides = true
)
public final class DebugApiModule {
@Provides @Singleton ApiEndpoint provideApiEndpoint(Locale locale, @ApiEndpointMarker StringPreference apiEndpoint,
@NetworkIgnoreLocale BooleanPreference ignoreLocale) {
return (ignoreLocale.get())
# Find open webviews on API 19 Android emulator.
def print_webviews
webviews = `adb shell cat /proc/net/unix`
webview_prefix = '@webview_devtools_remote_'
webviews = webviews.split("\r\n").reject { |l| ! l.include?(webview_prefix) }
# one pid may have many webviews
pids = webviews.map { |view| view.split(webview_prefix).last }.uniq
@bootstraponline
bootstraponline / taskport_osx10.9.xml
Last active December 28, 2015 15:29
system.privilege.taskport on OS X 10.9.
<!-- security authorizationdb read system.privilege.taskport > system.privilege.taskport.txt
DevToolsSecurity --enable
security authorizationdb write system.privilege.taskport is-developer
Fix developer popup.
Commands from: https://github.com/appium/appium/pull/1468
-->
<?xml version="1.0" encoding="UTF-8"?>
@bootstraponline
bootstraponline / espresso_mvn_fail.md
Created October 23, 2013 15:06
Espresso package fail
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:130)
	... 20 more
Caused by: java.lang.NoClassDefFoundError: Lorg/sonatype/aether/RepositorySystem;
	at java.lang.Class.getDeclaredFields0(Native Method)
	at java.lang.Class.privateGetDeclaredFields(Class.java:2397)
	at java.lang.Class.getDeclaredFields(Class.java:1806)
	at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:661)
	at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:366)
	at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
# Example of Ruby page object pattern
module App
module Splash
class << self
def login
'login'
end
end
end