Posts

Easy way to download whole youtube play list and convert them to mp3

Image
I love to keep my favorite musics on youtube. As the time go on some music has been deleted. So I have to download it and keep it local. But keep it as a video file will waste too much storage so I want to convert to mp3 file. After doing research I found a great solution. just one command to make things done. This app will download every youtube video in the list (and yet it can download a single video) then convert each video to mp3 files.

How to install
Open terminal
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install youtube-dl
youtube-dl --extract-audio --audio-format mp3 --ignore-errors <www.youtubeUrl-or-playlistUrl>

Plugin that help suggest and auto fix security for Android Developer

Image
Nows a day, the phone become much more important. Since it store so many sensitive information e.g. contacts, credit cards, private photo, e-mail, location and payment. It's not gonna be good if the other know how we live or pay or even pay some goods using our credit card.

Developer need to develop the app that secure enough for any users. However, its not easy to build the secure app because the technology always updated. New vulnerable has been discovered every day. Furthermore, developer have limited time to develop an app. 

I found a nice solution its the plugin for Android Studio. DevKnox is a plugin that scan the code and give suggestion for security vulnerable and mostly provides auto-fix. As I have tried this plugin. Its suggestion is great and it come with good explanation on each vulnerable. We can also use code-inspector that come with Android Studio(Analyze/Inspect code) it usually gives fewer security vulnerable suggestion.


Show how DevKnox suggest and provide auto-fix…

How to fix error Could not detect Mac OS X Version from sw_vers output: '10.12 ' from Appium

Image
Hi' Guys. Every software developers know the important  of software quality. We're often implement the test case for software manual test. It's help test bug and find errors of software so it's good but it's take so much time and lose focus on software process development. Besides it's waste money  and time because we has to hire software tester. So the Automated Testing is tool help increase quality software development.        Currently, I'm an android developer. I'm interested in automated testing and I'm using the Appium tool help in software process development at the Playbasis (Thailand) company. I see other user are got a problem same me about error “Could not detect Mac OS X Version from sw_vers output: '10.12 '”.

Oh my God I tired fix this problem several day. T_T

Wow!!! At last I discovered the solution.


First Step :
When you're see error you should read error and copy paste error in terminal.

Command by :
grep -rl "Could…

Using Google Chrome Inspect Element to Analyze the website

Image
I'm developing my new profile website. I want to reduce the loading time of my page. Google Chrome also provides the tool to help developer to analyze the websites.  So it's time to play with the "Google Chrome Inspect Element to Analyze the website"

1. I want to see how each element take time to load.

then I go back and modify some images and code. This is the result.
For the images I use the Photoshop "Save as Web" feature to help me consider which option is the best for my website. Actually, I will reduce the quality of the images down to 60-80% depend on each images.

This will greatly reduce the image file size but it still look beautiful. Furthermore, there are other options e.g. reduce the number of colors, reduce image size, use the vector file and more. This Technics are depend on each images. In the example below, You can see that jpg format gives the better image quality compare to .gif at the same file size. I think jpg is great for photo while g…

Begin to use vim in IntelliJ

Image
Install IdeadVim which is the most popular vim emulator in IntelliJ.

One of the most annoying thing using vim is the key esc. It's take 1-2 sec. to touche that esc key so I change it to j then k (my friend recommend this j,k key). The problems is I don't know how to change it until I found the answer in stackoverflow.



Study vim

openVim the interactive vim that gives you better exp. than just read the book.








Best way (for me) to paste the source code into the blog

I have search and found many tools and webs.

I decided to use hilite.me as my main tools

because it is beautiful, independent(no need to add code in to blogger's template)

the code look like this 


android { compileSdkVersion 18 buildToolsVersion "18.1.0"defversionPropsFile=file('version.properties') if (versionPropsFile.canRead()) { defProperties versionProps = new Properties() versionProps.load(new FileInputStream(versionPropsFile)) defcode= versionProps['VERSION_CODE'].toInteger() +1 versionProps['VERSION_CODE']=code.toString() versionProps.store(versionPropsFile.newWriter(), null) defaultConfig { versionCode code versionName "1.1" minSdkVersion 14 targetSdkVersion 18 } } else { throw new GradleException("Could not read version.properties!") } // rest of android block goes here }

[Android Gradle] Auto count the buildNumber and replaced in versionCode using gradle

Image
There are two methods.1. Modify the Android Manefist in gradle.buildtask('increaseVersionCode') << { defmanifestFile=file("AndroidManifest.xml") defpattern= Pattern.compile("versionCode=\"(\\d+)\"") defmanifestText= manifestFile.getText() defmatcher= pattern.matcher(manifestText) matcher.find() defversionCode= Integer.parseInt(matcher.group(1)) defmanifestContent= matcher.replaceAll("versionCode=\""+++versionCode +"\"") manifestFile.write(manifestContent) } tasks.whenTaskAdded { task ->if (task.name =='generateReleaseBuildConfig') { task.dependsOn 'increaseVersionCode' } }ref. stackoverflow2. Create modify the new files
android { compileSdkVersion 18 buildToolsVersion "18.1.0"defversionPropsFile=file('version.properties') if (versionPropsFile.canRead()) { defProperties versionProps = new Properties() ve…