Control ⌃
Option ⌥
Command ⌘
Shift ⇧
import pip | |
from subprocess import call | |
for dist in pip.get_installed_distributions(): | |
call("pip install --upgrade " + dist.project_name, shell=True) |
Permissions | |
Directories/Files Permissions | |
Public directories 0711 | |
Private Directories 0700 | |
Python scripts (.py) 0700 | |
CGI scripts (.py) 0755 | |
Regular files inside pub dirs (CSS, HTML, etc) 0644 |
.debug { border:1px dashed red; } |
# 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> |
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 |
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); |
/* 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 | |
} |
# Plug in device via USB first | |
adb devices | |
adb tcpip 5555 | |
# Unplug device | |
adb connect 192.168.1.10 | |
adb devices |
public boolean canConnect() { | |
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); | |
return activeNetworkInfo != null && activeNetworkInfo.isConnected(); | |
} |