Skip to content

Instantly share code, notes, and snippets.

@christophermark
christophermark / battery_capacities.md
Last active August 29, 2015 14:07
Small Battery Capacity Chart

Battery Capacities

Battery Capacity
CR1632 140 mAh
CR2032 225 mAh
CR2450 620 mAh
CR2477 1000 mAh
AAA 1200 mAh
AA 2500 mAh
@christophermark
christophermark / python_testing_stack.md
Last active August 29, 2015 14:14
A full Python testing stack

So you want to test?

A breakdown of a full Python testing stack

Updated January, 2015
Below is a layer-by-layer breakdown of how I test my Python projects, starting with my Github repository and ending with the test files themselves.

Layer 1: Travis-CI

www.Travis-CI.org

Testing begins with Travis-CI, which hooks into your Github repository to automatically run tests on pull requests and current production branches. It provides a nice visual representation of when tests are failing and a decent overview of all the tests scheduled to run. Travis integration is run through a .travis.yml file in the main project repository. Although Travis is itself a capable test runner, it is important to maintain the ability to run tests locally without having to submit a pull request to test. That's why we'll be using test runners such as tox as described below.

@christophermark
christophermark / Doze_Mode_Behavior.md
Last active August 20, 2021 21:37
Android Marshmallow Idle Mode Behavior

What is "idle mode"?

Idle mode is a state where the phone has no network connectivity and apps are temporarily suspended. Idle mode gets triggered by one of two ways: an asleep, still, unplugged phone (Doze mode), and when an app has not been opened in a significant amount of time (App Standby Mode). During idle mode via Doze, the phone will wake up periodically for a short amount of time, allowing apps to run and use network connectivity. Using several different methods outlined below, it is possible to wake apps up during idle mode outside of these maintenance windows.

Time to enter Doze mode

1 hour of being still after the screen turns off.

Time to enter App Standby mode

TBD

Idle maintenance windows

@christophermark
christophermark / private.xml
Last active January 17, 2016 19:04
Karabiner key remapping for waking android screen
<?xml version="1.0"?>
<root>
<!-- Shell Commands -->
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_unlock_android_screen</name>
<url type="shell">
<![CDATA[
~/Library/Android/sdk/platform-tools/adb shell input keyevent 82
]]>
</url>
@christophermark
christophermark / SampleRequest.py
Last active October 6, 2016 22:19
Robin Sample Request (Python)
# This is written for PYTHON 3
# Don't forget to install requests package
import requests
import json
spaceId = 'your space ID here'
apiToken = 'your api token here'
url = 'https://api.robinpowered.com/v1.0/spaces/{}/presence'.format(spaceId)
// List the full gradle dependencies for an Android app
./gradlew app:dependencies -q
@christophermark
christophermark / selectorDebugging.js
Created October 24, 2018 22:43
Selector Debugging
'use strict';
function getDependencies(funcs) {
const dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs
if (!dependencies.every(dep => typeof dep === 'function')) {
const dependencyTypes = dependencies.map(
dep => typeof dep
).join(', ')
throw new Error(
@christophermark
christophermark / eslint_cheatsheet.md
Last active March 25, 2019 14:27
ESLint Cheatsheet

Print ESLint Rules

./node_modules/eslint/bin/eslint.js --print-config .eslintrc.json > rules.json

Show all errors for a specific rule

// todo
@christophermark
christophermark / play_store_research.md
Last active October 13, 2022 16:06
Play Store Research
@christophermark
christophermark / adbCommand
Created April 29, 2020 18:27
ADB Constant logging debugging into logcat
adb logcat '*:W' > logcatWarningsAndErrors.txt