Skip to content

Instantly share code, notes, and snippets.

View sideffect0's full-sized avatar
🏠
Working from home

Renjith Thankachan (Dane) sideffect0

🏠
Working from home
View GitHub Profile
@sideffect0
sideffect0 / AppUtils.java
Last active February 15, 2018 13:17
Change App Icon at Runtime
package com.pytenlabs.mailcastr.utils;
public class AppUtils{
public static changeIconToPro(Context mContext){
getPackageManager().setComponentEnabledSetting(
new ComponentName("com.pytenlabs.mailcastr", "com.pytenlabs.mailcastr.MainActivityPro"),
@sideffect0
sideffect0 / build.gradle
Last active April 5, 2017 05:31
load gradle build variables or properties from properties file or system environment
apply from: "envutils.gradle"
// loading to data map
def data = loadFromEnvOrProp()
buildTypes {
release {
minifyEnabled false
buildConfigField "String", "API_URL", data["api.url"]
@sideffect0
sideffect0 / APIManager.java
Last active September 23, 2021 18:23
Retrofit Client with Persistent Cookie
class APIManager {
// client with persistent Cookie
public static OkHttpClient getRetrofitClient(final Context context) {
OkHttpClient client = new OkHttpClient();
CookieManager cookieManager = new CookieManager(new PersistentCookieStore(context), CookiePolicy.ACCEPT_ALL);
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
client.setCookieHandler(cookieManager);
return client;
}
[
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Åland Islands",
"code": "AX"
},
{
@sideffect0
sideffect0 / genymotionwithplay.txt
Created August 23, 2016 05:10 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
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 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@sideffect0
sideffect0 / xcode-cli-tools.sh
Last active January 5, 2016 16:39 — forked from trinitronx/xcode-cli-tools.sh
Script to download & install XCode Command Line tools on OSX 10.7 or 10.8. Lifted from jedi4ever/veewee template.
#!/bin/sh
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')
# Get Xcode CLI tools
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
TOOLS=clitools.dmg
if [ ! -f "$TOOLS" ]; then
if [ "$OSX_VERS" -eq 7 ]; then
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
elif [ "$OSX_VERS" -eq 8 ]; then
@sideffect0
sideffect0 / .gitignore
Last active August 29, 2015 14:18 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}
@sideffect0
sideffect0 / country_code
Created October 1, 2014 17:01
Create Country Code Select using `php-formhelper`
<?php
// using
// https://github.com/renlinx007/php-formhelper.git
require_once("CountryCodeHelper.php");
$e = CountryCodeHelper::dump_as_input_select("country");
echo $e;
?>