Control ⌃
Option ⌥
Command ⌘
Shift ⇧
| public boolean canConnect() { | |
| ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); | |
| NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); | |
| return activeNetworkInfo != null && activeNetworkInfo.isConnected(); | |
| } |
| /* 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 | |
| } |
| 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); |
| android update sdk --no-ui --all |
| 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 |
| # Setup | |
| git config --global user.name "Erik Cox" | |
| git config --global user.email "[email protected]" | |
| git config --global color.ui auto | |
| # Creating a new local repository | |
| git init | |
| # Cloning | |
| git clone <URL> |
| tmux new -s session_name -n window_name # Creates a new session with a named window | |
| tmux attach -t session_name # Attaches to tmux session | |
| tmux ls # Lists all tmux sessions | |
| #PREFIX is Ctrl-b by default | |
| PREFIX ? # Lists all commands available | |
| PREFIX d # Detaches window | |
| PREFIX c # New window | |
| PREFIX , # Rename window | |
| PREFIX n # Next window |
| .debug { border:1px dashed red; } |
| 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 |