This file contains hidden or 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 | |
IP=`host developer.download.nvidia.com 139.175.1.1 | tail -n 1 |cut -f 4 -d " "` | |
FILE_PATH="mobile/tegra/l4t/r21.2.0/pm375_release_armhf/Tegra_Linux_Sample-Root-Filesystem_R21.2.0_armhf.tbz2" | |
/usr/bin/wget --header="Host: developer.download.nvidia.com" -Y off -O /dev/null http://$IP/$FILE_PATH 2>wget.2 1>wget.1 | |
SPEED_SEED=`grep 100% wget.2` | |
echo $SPEED_SEED >> /root/speed.seednet | |
IP=`host developer.download.nvidia.com 168.95.1.1 | tail -n 1 |cut -f 4 -d " "` | |
wget --header="Host: developer.download.nvidia.com" -Y off -O /dev/null http://$IP/$FILE_PATH 2> wget.2 1> wget.1 |
This file contains hidden or 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
IS_PYTHON_3=False | |
try: | |
import urllib.request as urllib2 | |
IS_PYTHON_3=True | |
except ImportError: | |
IS_PYTHON_3=False | |
import urllib2 |
This file contains hidden or 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/perl | |
use File::Basename; | |
use Encode; | |
require Encode::Detect; | |
use base qw(Encode::Encoding); | |
use Encode qw(find_encoding); | |
use Encode::Detect::Detector; | |
use URL::Encode qw(url_encode_utf8 url_encode); | |
if($ARGV[1]=~m/(rar)|(zip)/i){ |
This file contains hidden or 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 | |
enable pwd | |
args=("$@") | |
DIR="$(cd "$(dirname "$0")" && pwd)" | |
case "${args[@]}" in | |
*".9.png"*) | |
$DIR/aapt.17 $@ | |
;; |
This file contains hidden or 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/perl | |
# Fix the following error, using gradle or Android Studio to build some projects with malformed 9 patch image | |
# | |
# aapt ERROR: 9-patch image malformed | |
# Frame pixels must be either solid or transparent (not intermediate alphas). | |
# | |
# put the file as sdk/build-tools/20.0.0/aapt and original aapt as aapt.20 | |
# put the file as sdk/build-tools/17.0.0/aapt and original aapt as aapt.17 | |
# force use aapt cruncher by adding: | |
# android.aaptOptions.useAaptPngCruncher = true |
This file contains hidden or 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 java.util.ArrayList; | |
import android.content.Context; | |
import android.graphics.Rect; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.view.accessibility.AccessibilityEvent; | |
This file contains hidden or 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
protected void onLayout(boolean changed, int l, int t, int r, int b) { | |
super.onLayout(changed, l, t, r, b); | |
int itemsPerView = getLastVisiblePosition() - getFirstVisiblePosition() + 1; | |
if ((getAdapter().getCount() / itemsPerView) > 3) { | |
setFastScrollEnabled(true); | |
setScrollBarStyle(View.SCROLLBARS_OUTSIDE_INSET); | |
}else{ | |
setFastScrollEnabled(false); | |
setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); |
NewerOlder