Skip to content

Instantly share code, notes, and snippets.

@AndrewKvalheim
AndrewKvalheim / all-unlock-options.patch
Last active December 16, 2015 15:39
Allow less-secure screen unlocks if the encryption password isn't synchronized.
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index f67213c..e015024 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -246,7 +246,8 @@ public class ChooseLockGeneric extends PreferenceActivity {
int encryptionStatus = mDPM.getStorageEncryptionStatus();
boolean encrypted = (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE)
|| (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVATING);
- if (encrypted) {
+ LockPatternUtils lockPatternUtils = new LockPatternUtils(getActivity());
@AndrewKvalheim
AndrewKvalheim / export-selected-regions.scm
Created September 11, 2012 21:56
GIMP script for automatically saving all selections
;;; Non-interactively save all selected regions as separate files
(define (script-fu-export-selected-regions image drawable)
;; Start
(gimp-image-undo-group-start image)
;; If there are selections
(when (= 0 (car (gimp-selection-is-empty image)))
(let ((number 1) (prefix "") (suffix ""))
;; Construct filename components
(let* ((parts (strbreakup (car (gimp-image-get-filename image)) "."))
@AndrewKvalheim
AndrewKvalheim / monokai.sh
Created August 31, 2012 20:22
Monokai color scheme for mintty
#!/bin/bash
# Applies the Monokai color scheme to the current terminal session.
declare -A map0
map0=( [foreground ]='#F8F8F2' [background ]='#272822'
[cursor ]='#F8F8F0' [selection ]='#49483E'
[pink ]='#F92672' [green ]='#A6E22E'
[yellow ]='#E6DB74' [blue ]='#66D9EF'
[purple ]='#AE81FF' [orange ]='#FD971F'
[gray ]='#75715E' )