git clone https://gist.github.com/08be90a2f21205062ccc.git
$ npm install # maybe npm start will take care of it but just in case
$ npm start && open out.png
> [email protected] start /Users/bsergean/src/offscreen_sample
| const log = new Proxy({}, { | |
| get: (_, colour) => function() { | |
| console.log(`%c ${[].slice.call(arguments).join(' ')}`, `color: ${colour}`) | |
| } | |
| }) | |
| // example | |
| log.tomato('I am tomato') | |
| log.chocolate('I am chocolate') | |
| log.cornflowerblue('I am cornflowerblue') |
| #!/usr/bin/env sh | |
| ## I don't have any devices running Android OS now. These settings may have been outdated but I cannot verify it. | |
| adb shell settings put global captive_portal_fallback_url http://g.cn/generate_204 | |
| adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204 | |
| adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204 | |
| adb shell settings put global captive_portal_other_fallback_urls http://www.qualcomm.cn/generate_204 |
| /* | |
| * @fileoverview Program to free the content in kindle books as plain HTML. | |
| * | |
| * This is largely based on reverse engineering kindle cloud app | |
| * (https://read.amazon.com) to read book data from webSQL. | |
| * | |
| * Access to kindle library is required to download this book. | |
| */ | |
| // The Kindle Compression Module copied from http://read.amazon.com application |
git clone https://gist.github.com/08be90a2f21205062ccc.git
$ npm install # maybe npm start will take care of it but just in case
$ npm start && open out.png
> [email protected] start /Users/bsergean/src/offscreen_sample
| var touchstartX = 0; | |
| var touchstartY = 0; | |
| var touchendX = 0; | |
| var touchendY = 0; | |
| var gesuredZone = document.getElementById('gesuredZone'); | |
| gesuredZone.addEventListener('touchstart', function(event) { | |
| touchstartX = event.screenX; | |
| touchstartY = event.screenY; |
| TWITTER_CONSUMER_KEY="" | |
| TWITTER_CONSUMER_SECRET="" | |
| TWITTER_SEARCH_STRING="#tedc15 -rt" |
| /** | |
| * A string builder with built-in support for ANSI escape sequences. | |
| * | |
| * @author Nathan Fiscaletti | |
| */ | |
| public class AnsiStringBuilder | |
| { | |
| /** | |
| * Reset options. | |
| */ |
| #!/bin/sh | |
| adb shell "mount -o rw,remount /system" | |
| adb shell "stop b2g" | |
| adb shell "echo \"ro.moz.wifi.p2p_supported=1\" >> /system/build.prop" | |
| adb shell "mount -o ro,remount /system" | |
| adb reboot |
| #!/bin/sh | |
| if test $# -lt 1 ; then | |
| echo "Usage: download_apk.sh <GooglePlayPackageName>" | |
| exit 1 | |
| fi | |
| PACKAGE=$1 | |
| APK_PATH=`adb shell pm list packages -f -3 | grep $PACKAGE | cut -d'=' -f 1 | cut -c9-` | |
| echo "Pulling $APK_PATH from device" | |
| echo `adb pull ${APK_PATH} ./${PACKAGE}.apk` |