Skip to content

Instantly share code, notes, and snippets.

View lewiswon's full-sized avatar

lewis luo lewiswon

View GitHub Profile
@lewiswon
lewiswon / depennds.sh
Created March 5, 2020 18:19
下载ubuntu的deb包,,用于离线安装
PACKAGE=$1
DEPENDS=$(apt-rdepends "$PACKAGE" 2>/dev/null | grep -v '^ ')
mkdir $PACKAGE; cd $PACKAGE
for D in $DEPENDS; do
echo "downloading for $D"
apt-get download "$D"
done
@lewiswon
lewiswon / height.java
Created August 4, 2017 14:01 — forked from hamakn/height.java
Android: Get height of status, action, navigation bar (pixels)
// status bar height
int statusBarHeight = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
// action bar height
int actionBarHeight = 0;
final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes(
@lewiswon
lewiswon / apkinfo.sh
Created October 11, 2016 08:44 — forked from forthxu/apkinfo.sh
获取apk的name,icon,version,permissions,RSA等信息
#!/bin/bash
#@author forthxu.com
#说明
#找到获取apk信息有两种方式
#一种解压后读取AndroidManifest.xml,解压最好不要通过unzip因为获取的是压缩过的内容,读取不准确,可用apktool反编译解压
#另外一种可通过aapt也就是官方sdk中提供的工具读取信息
#aapt和apktoool工具 https://code.google.com/p/android-apktool
#可能存在的问题 http://www.qiansw.com/centos-apk-apktool.html
#扩展阅读,汉化apk http://bbs.dospy.com/thread-9991523-1-354-1.html
@lewiswon
lewiswon / GuideVC.m
Last active September 27, 2016 09:11
iOS user guide demo in OC
#import "GuideVC.h"
#import "Masonry.h"
@interface GuideVC ()<UICollectionViewDataSource>
@end
@implementation GuideVC
-(void)viewWillAppear:(BOOL)animated{
[self.navigationController setNavigationBarHidden:YES];
}