Skip to content

Instantly share code, notes, and snippets.

View AndrewKvalheim's full-sized avatar

Andrew AndrewKvalheim

View GitHub Profile
@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' )
@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 / 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());

Keybase proof

I hereby claim:

  • I am AndrewKvalheim on GitHub.
  • I am andrewkvalheim on Keybase.
  • I have a public key whose fingerprint is 3BE8 FAF9 6A55 8283 9915 0084 9254 D459 4094 9194.

To claim this, I am signing this object:

@AndrewKvalheim
AndrewKvalheim / .gitattributes_global
Last active August 29, 2015 14:10
Git diff driver for Anki decks
*.apkg diff=apkg
/ Documentation: http://www.sitemaps.org/protocol.html
doctype xml
urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'
- pages.each do |page|
url
loc = page.absolute_url
lastmod = page.mtime.iso8601
changefreq = page.data.changefreq || 'weekly'

How to upgrade end-of-life Ubuntu 13.04

Ubuntu 13.04 has reached [end-of-life (EOL)][eol], so software updates to it are no longer available. It will continue to check for software updates, however, and fail with error messages such as:

Failed to download repository information.

and:

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring/main/source/Sources  404  Not Found
@AndrewKvalheim
AndrewKvalheim / use-epost-without-proprietary-software.user.js
Created September 23, 2015 22:05
Use epost™ without proprietary software.
// ==UserScript==
// @name Use epost™ without proprietary software.
// @namespace https://Andrew.Kvalhe.im/
// @version 0.1.0
// @description Override the "Adobe Reader Required" message in Canada Post's epost™ service.
// @match https://express.epost.ca/edms/en/pdfPlugin.html*
// @grant none
// ==/UserScript==
window.overRide();
@AndrewKvalheim
AndrewKvalheim / select-redundant-nodes.js
Last active January 29, 2020 19:18
JOSM script to select redundant nodes in buildings
// Given a selection of buildings, select redundant (i.e. collinear, non-tagged,
// non-glued) nodes.
//
// Dependencies:
//
// - [JOSM Scripting Plugin](https://gubaer.github.io/josm-scripting-plugin/)
//
// Usage:
//
// 1. Select some buildings for analysis, e.g. via Search → `new building`.

Static site generators

Frameworks

Healthy community Zero runtime PostCSS Sitemap API Omit file extensions
[Eleventy] ✔ [#272]
[Eleventy] + [Parcel] ❌ [L180]
[Gatsby.js] ❌ [#962]
[Gridsome] ❌ [#1000]