Skip to content

Instantly share code, notes, and snippets.

View wangyung's full-sized avatar

Freddie Wang wangyung

View GitHub Profile
@wangyung
wangyung / .fonts.conf
Last active February 13, 2016 08:17 — forked from silv3rm00n/.fonts.conf
Tweak .fonts.conf for better looking fonts http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux/
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@wangyung
wangyung / ls.bat
Created October 7, 2015 15:37
create 'ls' in windows cmd
rem Run below as administrator
echo dir %1 > %systemroot%\system32\ls.bat
@wangyung
wangyung / blur.rs
Created December 8, 2015 14:36
Renderscript for blur
RenderScript rs = RenderScript.create(theActivity);
ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur.create(mRS, Element.U8_4(rs));;
Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap);
Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap);
theIntrinsic.setRadius(25.f);
theIntrinsic.setInput(tmpIn);
theIntrinsic.forEach(tmpOut);
tmpOut.copyTo(outputBitmap);
@wangyung
wangyung / launch-android-emu.sh
Last active April 4, 2017 03:28
Start android emulator
#!/bin/bash
#stop emulator
process=`ps -ef | awk '/[e]mulator/{print $2}'`
for i in $process; do
kill -9 $i;
done
#launch emulator
$ANDROID_SDK_PATH/tools/emulator -avd hudson_ja-JP_240_480x640_android-21_armeabi-v7a_creators-market -no-window &
@wangyung
wangyung / create-android-emulator.sh
Created April 5, 2017 02:37
Create android emulators via command line
#!/bin/bash
#old style, it's deprecated
android create avd -f -a -s 480x640 -n hudson_en-US_160_480x640_android-19_armeabi-v7a_creators-market -t android-19 --abi armeabi-v7a
#new style, use avdmanager
@wangyung
wangyung / stop-emulators
Created April 5, 2017 03:56
Stop android emulators
#!/bin/bash
#stop emulator
process=`ps -ef | awk '/[e]mulator/{print $2}'`
for i in $process; do
kill -9 $i;
done
@wangyung
wangyung / mactips.sh
Last active September 14, 2020 15:41
some mac os tips #mac #tips
#1. Show hidden files in Finder
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
#2. Show full path in Finder
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
#3. Cancel the auto backup in iTunes
defaults write com.apple.iTunes DeviceBackupsDisabled -bool true
@wangyung
wangyung / gist:3c50a9bc32f63c10b0421f5e045f16d7
Last active September 18, 2020 17:32
windows tips #tips #windows
  1. Fix the hidden attribue can't be changed in files
    attrib -s -h file1, file2 …

  2. Recovery "show desktop" command

#Edit Desktop.scf with
[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
@wangyung
wangyung / deploy.gradle
Last active June 15, 2017 03:38
Deploy the artifact to local directory
publishing {
publications {
maven(MavenPublication) {
groupId 'THE_GROUP_ID'
artifactId project.name
version android.defaultConfig.versionName
artifact source: file("${project.buildDir}/outputs/aar/${project.name}-release.aar")
}
}
repositories {
@wangyung
wangyung / _ConstraintLayout.kt
Created August 9, 2017 03:45 — forked from anonymous/_ConstraintLayout.kt
Anko ConstraintLayout
import android.app.Activity
import android.content.Context
import android.support.constraint.ConstraintLayout
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.view.ViewManager
import org.jetbrains.anko.AnkoViewDslMarker
import org.jetbrains.anko.custom.ankoView