This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ldclient.config import Config | |
from ldclient import LDClient | |
import time | |
# Set the SDK key you get from your LaunchDarkly environment | |
sdk_key = "API_KEY" | |
# Create a configuration object | |
config = Config(sdk_key=sdk_key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ast import arg | |
import sys | |
import json | |
# should pass the path of the appsettings.json file as the first argument | |
# should pass the path of the .env file as the second argument | |
# python3 turn_app_setting_json_to_dotenv.py appsettings.json config.env | |
with open(sys.argv[1]) as file_obj: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This extracts the arcana and relic information from the gamepedia wiki | |
// just go to the console and paste this script and you will have the full information in a json format | |
// inside arcanaJson and relicJson variables | |
let tables = []; | |
let arcanaTables = []; | |
let arcanaJson = []; | |
let arcanaCsv; | |
let relicTables = []; | |
let relicJson = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaultConfig { | |
# Add 10000 to move past old SVN revisions. | |
versionCode gitCommitCount() + 10000 ?: 0 | |
} | |
def gitCommitCount() { | |
try { | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'rev-list', '--count', 'HEAD' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
applicationVariants.all { variant -> | |
variant.assemble.doLast { | |
//If this is a 'release' build, reveal the compiled apk in finder/explorer | |
if (variant.buildType.name.contains('release')) { | |
def path = null | |
variant.outputs.each { output -> | |
path = "${rootDir}/${project.name}/build/outputs/apk/release/${output.outputFileName}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Import Utils from somewhere | |
public class BaseActivity extends Activity { | |
private ViewTreeObserver.OnGlobalLayoutListener keyboardLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { | |
int navigationBarHeight = Utils.getNavigationBarHeight(BaseActivity.this); | |
int statusBarHeight = Utils.getStatusBarHeight(BaseActivity.this); | |
// display window size for the app layout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Check whether the passed permissions are granted and if not it requests them. | |
* @param activity The activity that requires the permissions | |
* @param requestCode The request code | |
* @param permissions The permissions you want to grant | |
*/ | |
public static void requestPermissionsNotAllowed(@NonNull Activity activity, | |
@NonNull int requestCode, | |
@NonNull String... permissions){ | |
ArrayList<String> missing = new ArrayList<>(permissions.length); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Normalize assets | |
# Sometimes in Android development you find designers that make your assets names with "-" this makes | |
# the android compiler to fail as assets cannot have "-", I create this script to solve this problem | |
# recursively renaming the files and replacing "-" with "_" plus making them lowercase. | |
# | |
# Instructions: | |
# 1- Move this script to your Android {PROJECT_BASE_FOLDER}/app/src/main/res | |
# 2- run it with sudo ex: "sudo ./rename_script.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NetworkStateReceiver extends BroadcastReceiver { | |
protected List<NetworkStateReceiverListener> listeners; | |
protected Boolean connected; | |
public NetworkStateReceiver() { | |
listeners = new ArrayList<NetworkStateReceiverListener>(); | |
connected = null; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log; | |
/** | |
* @author eefret | |
* Created by Christopher T. Herrera (eefret) on 4/22/2014 [12:41 AM] | |
* Wrapper class for android Logging utility will select a tag automatically from class, method and line number executed. | |
*/ | |
public class Logger { | |
//TODO Create a detail Enum to define the log detail level. | |
//TODO Create a method that halt every log possible based on the development mode Ex: (PRODUCTION, DEVELOPMENT, DEBUG) that can manage what can be and can't be logged |