Skip to content

Instantly share code, notes, and snippets.

@isao
isao / ADB Commands
Created June 8, 2018 17:24 — forked from TheMightyLlama/ADB Commands
List of ADB commands for obtaining information from an application
#Gets screen capture of device every 270 seconds and outputs screencap to timestamped png file in local directory
while true; do adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ScreenCap.`date +%Y`.`date +%m`.`date +%d`-`date +%H`.`date +%M`.`date +%S`.png; sleep 270; done
#Gets logs from device and outputs them to a timestamped file in local directory
while true; do adb logcat -v time > logging`date +%Y`.`date +%m`.`date +%d`-`date +%H`.`date +%M`.`date +%S`.txt; done
#Gets PID of <packagename>
adb shell ps | grep <packagename>
#Outputs battery level to console
@isao
isao / push-apk.sh
Created June 5, 2018 23:14
push-apk.sh
#!/bin/bash -eu
#
# Config.
#
# Arg 1: file to install on the Android OTT STB, which must be connected, and
# mounted read/write as root. See connect-remount-as-root.sh
apkpath=${1:-''}
@isao
isao / functions.sh
Created May 24, 2018 21:23 — forked from junegunn/functions.sh
Key bindings for git with fzf (https://junegunn.kr/2016/07/fzf-git/)
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% "$@" --border
}
@isao
isao / web-servers.md
Created May 11, 2018 21:52 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@isao
isao / GIF-Screencast-OSX.md
Created April 13, 2018 20:08 — forked from baumandm/GIF-Screencast-OSX.md
OS X Screencast to Animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime and ffmpeg.

Forked from https://gist.github.com/dergachev/4627207. Updated to use a palette to improve quality and skip gifsicle.

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@isao
isao / programming-quotes.md
Created November 8, 2017 18:17 — forked from Potherca/README.md
Programming Quotes
source: http://quotes.cat-v.org/programming/

Programming Quotes

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.

        — C.A.R. Hoare, The 1980 ACM Turing Award Lecture

@isao
isao / hydra-alias.md
Created May 21, 2017 21:24 — forked from developit/hydra-alias.md
Alias to invoke Chrome Canary w/ tracing, for IRHydra

An Alias to run Chrome with tracing enabled

For Chrome Canary:

alias hydra='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --no-sandbox --js-flags="--user-data-dir=/tmp/profile --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces"'

For regular ol' Chrome:

@isao
isao / requestIdleCallback.js
Created March 23, 2017 02:53 — forked from paullewis/requestIdleCallback.js
Shims rIC in case a browser doesn't support it.
/*!
* Copyright 2015 Google Inc. All rights reserved.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@isao
isao / b.rb
Created March 20, 2017 19:03 — forked from junegunn/b.rb
b - browse Chrome bookmarks with fzf
#!/usr/bin/env bash
# vim: set filetype=ruby:
# b - browse Chrome bookmarks with fzf
[ $(uname) = Darwin ] || exit 1
which fzf > /dev/null 2>&1 || brew reinstall --HEAD fzf || exit 1
/usr/bin/ruby -x "$0" |
fzf-tmux -u 30% --ansi --multi --no-hscroll --tiebreak=begin |
awk 'BEGIN { FS = "\t" } { print $2 }' |
@isao
isao / chpwd_update_git_vars.sh
Created March 2, 2016 17:57 — forked from scelis/chpwd_update_git_vars.sh
Add git information to your ZSH prompt.
update_current_git_vars