Skip to content

Instantly share code, notes, and snippets.

@tushroy
tushroy / LICENSE.txt
Last active August 29, 2015 14:06 — forked from addyosmani/README.md
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2014
Copyright (C) 2014 Addy Osmani @addyosmani
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 4.4.2 (https://www.mediafire.com/?qbbt4lhyu9q10ix)
Google Apps for Android 4.3 (http://goo.im/gapps/gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (http://goo.im/gapps/gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (http://goo.im/gapps/gapps-jb-20121011-signed.zip)
Dim http
Set http = CreateObject("MSXML2.ServerXmlHttp")
http.open "GET", "http://ifconfig.me/ip", False
http.send
Dim ipText
ipText = http.responseText
Set http = Nothing
Set objMail = CreateObject("CDO.Message")
Set objConf = CreateObject("CDO.Configuration")
@tushroy
tushroy / gist:11180204
Created April 22, 2014 13:55
storage size android
//internal storage
StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath());
long blockSize = statFs.getBlockSize();
long totalSize = statFs.getBlockCount()*blockSize;
long availableSize = statFs.getAvailableBlocks()*blockSize;
long freeSize = statFs.getFreeBlocks()*blockSize;
//esternal storage
StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getAbsolutePath());
long blockSize = statFs.getBlockSize();
int day = datePicker.getDayOfMonth();
int month = datePicker.getMonth() + 1; //plus 1 for making correct format
int year = datePicker.getYear();
long unixtime;
String date = ""+day+month+year; //making String for SimpleDateFormat
DateFormat dfm = new SimpleDateFormat("ddMMyyyy"); // instantiate SimpleDateFormat
try{
@tushroy
tushroy / AutoCompleteTextView limit result
Last active December 30, 2015 12:29
AutoCompleteTextView the suggestions will be limited. but since the method used in base class is private can't override it in child.
private void buildImeCompletions() {
final int limit_result=20;
//change the limit_result value
final ListAdapter adapter = mAdapter;
if (adapter != null) {
InputMethodManager imm = InputMethodManager.peekInstance();
if (imm != null) {
final int count = Math.min(adapter.getCount(), limit_result);
CompletionInfo[] completions = new CompletionInfo[count];