Skip to content

Instantly share code, notes, and snippets.

Avatar

Stuart Kent stkent

View GitHub Profile
@stkent
stkent / shortcuts.md
Last active Jan 3, 2020
Favorite Android Studio Shortcuts, v2 (Mac)
View shortcuts.md

Exploring

Description Shortcut
Previous/next cursor position Cmd [ / Cmd ]
Open recently used file Cmd E
Open class Cmd O
Open file Cmd Shift O
Open symbol Cmd Opt O
Find string/regex in file Cmd F
@stkent
stkent / android-bluetooth-low-energy-resources.md
Last active Jul 30, 2021
Android Bluetooth Low Energy (BLE) Resources
View android-bluetooth-low-energy-resources.md
@stkent
stkent / BlockingIntentService
Created Sep 2, 2016 — forked from SeanPONeil/BlockingIntentService.java
An extension of the IntentService class that will block an Intent from entering the queue if the same Intent is already in the queue.
View BlockingIntentService
package com.atami.mgodroid.util;
import java.util.LinkedList;
import android.app.IntentService;
import android.content.Intent;
/**
* An extension of the IntentService class that will block
@stkent
stkent / intellij-config.md
Last active Aug 25, 2020
IntelliJ configuration
View intellij-config.md

I've tried to sync IntelliJ/Android Studio configurations across installs/machines using several different methods (including the built-in settings repository), and none seem to work as reliably as I would like.

This is a manual setup checklist that replaces those methods.

Last checked: IntelliJ Ultimate 2020.2

IntelliJ Configuration

In Editor -> Font:

  • Set Size to 15.
@stkent
stkent / gpg-import-and-export-instructions.md
Created Apr 23, 2016 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys
View gpg-import-and-export-instructions.md

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
@stkent
stkent / themes-debug.xml
Last active Aug 27, 2015 — forked from dlew/themes-debug.xml
With the new theming in AppCompat, a lot of assets are tinted automatically for you via theme attributes. That has often led me to wonder "where the hell did this color come from?" You can replace your normal theme with this debug theme to help figure out the source of that color.
View themes-debug.xml
<!-- You can change the parent around to whatever you normally use -->
<style name="DebugColors" parent="Theme.AppCompat">
<!-- System colors -->
<item name="android:windowBackground">@color/__debugWindowBackground</item>
<item name="android:colorPressedHighlight">#FF4400</item>
<item name="android:colorLongPressedHighlight">#FF0044</item>
<item name="android:colorFocusedHighlight">#44FF00</item>
<item name="android:colorActivatedHighlight">#00FF44</item>
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
@stkent
stkent / android_studio_shortcuts.md
Last active Jul 1, 2021
Android Studio Shortcuts (Mac)
View android_studio_shortcuts.md

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols: