I hereby claim:
- I am benhylau on github.
- I am benhylau (https://keybase.io/benhylau) on keybase.
- I have a public key whose fingerprint is 3748 E7C4 4ED7 18C9 51F9 27AC 9D9F 2856 67B7 9B2E
To claim this, I am signing this object:
/** | |
* Gets the size of content fitted inside a container while maintaining its aspect ratio. | |
* | |
* @param containerWidth width of the container. | |
* @param containerHeight height of the container. | |
* @param contentWidth width of the content. | |
* @param contentHeight height of the content. | |
* @return a {@link Point} where the (x, y) corresponds to the (width, height) of the content fitted inside the | |
* container. | |
*/ |
$ adb backup -f data.ab APPLICATION_PACKAGE | |
$ dd if=data.ab bs=1 skip=24 | python -c "import zlib, sys; sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf - -C . | |
$ sqlite3 DATABASE_FILE | |
$ SELECT name FROM sqlite_master WHERE type='table'; |
I hereby claim:
To claim this, I am signing this object:
/** | |
* Provides a callback when a non-looping {@link AnimationDrawable} completes its animation sequence. More precisely, | |
* {@link #onAnimationCompleted()} is triggered when {@link View#invalidateDrawable(Drawable)} has been called on the | |
* last frame. | |
* | |
* @author Benedict Lau | |
*/ | |
public abstract class AnimationDrawableCallback implements Callback { | |
/** |
#!/bin/bash | |
# | |
# This version uses September 2016 rpi jessie image, please use this image | |
# | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be root" | |
exit | |
fi |
Imagine you're messing around in a container, and you install some stuff, add some config, and now it's time to load up your client and check it out! Oh wait, you forgot to forward ports when you created the container! Fear not, all is not lost, for in the world of pipes, and streams, there is always a way to do something disgusting.
Example Dockerfile included will install Nginx, and socat in a container, and make Nginx run in foreground mode. To build, and run:
# ipfs Gateways | |
internet -> http://178.62.223.245/ipfs/ | |
cjdns -> http://[fc44:ff51:390e:f401:3045:c8d5:47af:a745]/ipfs/ | |
# ipfs Pinned Snapshots | |
tr.wikipedia-on-ipfs.org -> /ipfs/QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX | |
# cjdns Public Peerings |
[Unit] | |
Description=Demonstrate Bash | |
[Service] | |
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))" | |
ExecStart=/usr/bin/ech "2 + 2 = ${MYVAR}" |
#!/bin/sh | |
# | |
# Read-only Root-FS for Raspian | |
# | |
# Modified 2016 by Stefan Bonfert to make it compatible with Raspbian | |
# Jessie (vanilla). | |
# | |
# Modified 2015 by Pascal Rosin to work on raspian-ua-netinst with | |
# overlayfs integrated in Linux Kernel >= 3.18. | |
# |