$ python3 revoke_permission.py
$ python3 revoke_permission.py <device_code>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2015 Tuan Chau (tuanchauict) | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.pm.PackageManager; | |
import android.os.Build; | |
import android.support.annotation.NonNull; | |
import android.support.v4.app.ActivityCompat; | |
import android.support.v4.content.ContextCompat; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.SparseArray; | |
import java.util.ArrayList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.widget.FrameLayout; | |
/** | |
* Created by tuanchauict on 11/18/15. | |
*/ | |
public class AspectRatioFrameLayout extends FrameLayout { | |
private static final float DEFAULT_RATIO = 109.33f / 144f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb shell << 'END' | |
run-as <package_id> | |
chmod 777 shared_prefs/<prefs_file_name>.xml | |
exit | |
cp /data/data/<package_id>/shared_prefs/<prefs_file_name>.xml /sdcard/Download/prefs.xml | |
exit | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Add this to functions.php */ | |
add_filter( 'woocommerce_shortcode_products_query', 'woocommerce_shortcode_products_orderby' ); | |
function woocommerce_shortcode_products_orderby( $args ) { | |
$standard_array = array('menu_order','title','date','rand','id'); | |
if( isset( $args['orderby'] ) && !in_array( $args['orderby'], $standard_array ) ) { | |
$args['meta_key'] = '_price'; | |
$args['orderby'] = 'meta_value_num'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Performs a dump of target database and compresses result. | |
# Outputs to: $DUMPDIR/$DUMPNAME.tar.xz | |
# Note: Absolute paths are required for use in cron jobs | |
DBNAME=meteor | |
ROOTDIR=/Users/alanning/foo | |
DUMPDIR=$ROOTDIR/dumps |
Latest Inkscape version has this functionality built-in now - except for internal links. For that, see https://github.com/oxplot/svglinkify
A simple script for adding a jump key (N
/ B
) with two guidelines to help reading on PC easier.
The progress is also more trackable with page and percent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Create a page in the current dir | |
echo "My Test Page" > test.html | |
# Start server | |
python -m SimpleHTTPServer 8000 &> /dev/null & | |
pid=$! | |
# Give server time to start up |
OlderNewer