This file contains 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
// Social tag generator | |
http://secretsaucehq.com/mega-tags/ | |
// Social media optimizer | |
http://smo.knowem.com | |
// Social media ranking tool | |
http://socialdebug.com | |
// Twitter card validator |
This file contains 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
// One | |
if(BuildConfig.DEBUG) { | |
Toast.makeText(this, "Debug mode", Toast.LENGTH_SHORT).show(); | |
} | |
// Two | |
try { | |
appInfo = pacMan.getApplicationInfo(pacName, 0); | |
} catch (NameNotFoundException e) { | |
Toast.makeText(this, "Could not find package " + pacName, Toast.LENGTH_SHORT).show(); |
This file contains 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
android update sdk --no-ui --all |
This file contains 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 boolean canConnect() { | |
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); | |
return activeNetworkInfo != null && activeNetworkInfo.isConnected(); | |
} |
This file contains 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
# Plug in device via USB first | |
adb devices | |
adb tcpip 5555 | |
# Unplug device | |
adb connect 192.168.1.10 | |
adb devices |
This file contains 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
/* Look into android.provider.Settings | |
Not all settings may be available on customized versions of Android, | |
so be sure to catch ActivityNotFoundException. */ | |
try { | |
startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)); | |
} catch (ActivityNotFoundException e) { | |
// Unavailable | |
} |
This file contains 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
function fizzBuzz(n) { | |
for (i = 0; i <= n; i++) { | |
if (i % 15 === 0) { | |
console.log("FizzBuzz"); | |
} else if (i % 3 === 0) { | |
console.log("Fizz"); | |
} else if (i % 5 === 0) { | |
console.log("Buzz"); | |
} else { | |
console.log(i); |
This file contains 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
mkvirtualenv [ENV_NAME] # creates and activates a fresh virtual environment | |
rmvirtualenv [ENV_NAME] # removes virtual environment | |
workon [ENV_NAME] # activates an already-created virtual environment | |
deactivate # deactivates the virtual environment that is currently active | |
# within an activated virtualenv | |
pip install [PACKAGE_NAME] #installs a package into the virtualenv | |
pip freeze # lists the packages that is installed & accessible within the virtualenv |
This file contains 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
# Setup | |
git config --global user.name "Erik Cox" | |
git config --global user.email "erikbcox@gmail.com" | |
git config --global color.ui auto | |
# Creating a new local repository | |
git init | |
# Cloning | |
git clone <URL> |
This file contains 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
.debug { border:1px dashed red; } |