- Install password manager or setup company provided
- Create AppleID or get one from your corporate account
- Install browser extensions for password manager
- Setup fingerprint unlock
- Dark Theme
- Enable 24hr clock
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
" Show line numbers | |
set number | |
" Use spaces instead of tabs | |
set expandtab | |
" Be smart when using tabkey | |
set smarttab | |
" 1 tab == 4 spaces |
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
# optional exit code | |
CODE=0 | |
cleanup() { | |
echo "[${SCRIPT_NAME}] Cleaning stuff up..." | |
exit ${CODE} | |
} | |
# should be defined early in the script since bash doesn't provide function hoisting | |
trap cleanup EXIT |
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
const megabytes = Math.round(process.memoryUsage().heapUsed / 1024 / 1024); | |
console.log(`The script uses approximately ${megabytes} MB`); |
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
for f in $(ls); do mv ${f} ${f/tacos-/burgers}; done |
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 static void exportAllDatabases(final Context context) { | |
Log.d(LOG_TAG, "exportAllDatabases: "); | |
File sd = Environment.getExternalStorageDirectory(); | |
if (sd.canWrite()) { | |
final File[] databases = new File(context.getFilesDir().getParentFile().getPath() + "/databases").listFiles(); | |
for (File databaseFile: databases) { | |
final String backupFilename = databaseFile.getName() + "-" + Build.SERIAL + | |
"-" + System.currentTimeMillis() + ".db"; | |
File backupFile = new File(sd, backupFilename); | |
FileChannel inputChannel = null; |
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 { | |
...... other stuff here | |
.... | |
// Rename output apk file to use semantic versioning (gradle 3.2+) | |
// This will create hyde-x.x.x-${productFlavor}-${buildType}-${isSigned}.apk | |
applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
def originalOutputFile = output.outputFile | |
output.outputFile = new File(originalOutputFile.parentFile, | |
originalOutputFile.name.replace("${archivesBaseName}", "${archivesBaseName}-${variant.versionName}")) |
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
# SED Search/Replace all files of type in a directory: | |
find ./ -type f -name "*.js" -print0 | xargs -0 sed -i .bak 's;<search-string>;<replace-string>' | |
# Find all files and exclude a pattern. The o option is essentially 'or' so this does exclude or print | |
find ./ -path "./my/path/to/ignore/" -prune -o -print |
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
#!/bin/bash | |
####################################################################### | |
# Examples of using the find commands | |
####################################################################### | |
# This is an unsafe and bad way to loop over output of find commands | |
# One should use the while read loop to avoid potential errors with the output | |
# of the find command. See below: | |
for file in $(find . -maxdepth 1 -type d -path Projects -prune -o -print); | |
do |
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 service skeleton that performs intensive off main thread database operations. | |
This example uses a HandlerThread which will queue up requests rather than parallelize | |
them, which is good for database operations. | |
*/ | |
public class MyDatabaseService extends Service { | |
private HandlerThread databaseThread; | |
private Handler databaseHandler; | |
private MyDatabaseHelper dbHelper; |
NewerOlder