Skip to content

Instantly share code, notes, and snippets.

View Calvin-LL's full-sized avatar

Calvin Liang Calvin-LL

View GitHub Profile
@Calvin-LL
Calvin-LL / Nav.kt
Last active April 9, 2024 05:08
Jetpack Compose NavHost transitions based on the default built-in Android native activity transitions
NavHost(
// ...
enterTransition = { ActivityOpenEnter },
exitTransition = { ActivityOpenExit },
popEnterTransition = { ActivityCloseEnter },
popExitTransition = { ActivityCloseExit },
) {
// ...
}
@Calvin-LL
Calvin-LL / formatter-binding.rkt
Last active October 21, 2021 02:49
DrRacket Code Formatting Keybinding
#lang s-exp framework/keybinding-lang
(require fmt)
(define (format editor event)
(define text (send editor get-text))
;; for more options, see https://docs.racket-lang.org/fmt/
(define formatted-text (program-format text #:max-blank-lines +inf.0))
(send editor insert formatted-text 0 (string-length text) #f))
@Calvin-LL
Calvin-LL / comment-binding.rkt
Last active October 21, 2021 01:26
DrRacket Comment Keybinding
#lang s-exp framework/keybinding-lang
;; definitions:
;; commented line: a line where the first non-blank character is ";"
;; non-commented line: any line that isn't a commented line
;;
;; selected line: all partially or fully selected lines
;; blank line an empty line or a line with only spaces
;;
;; behavior:
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@Calvin-LL
Calvin-LL / .csscomb-concentric-css.json
Created January 18, 2020 21:36
Concentric-CSS sort order for csscomb with empty lines
{
"sort-order": [
[
"all"
],
[
"box-sizing"
],
[
"display",
@dragon788
dragon788 / .crypt-fix.md
Last active March 13, 2024 09:52
Repair "ubuntu--vg-root" not found with LUKS and LVM encryption

Crypt-fix

Use this script via curl -L -O https://gist.github.com/dragon788/e777ba64d373210e4f6306ad40ee0e80/raw/a86f3d05fb56feb6ef01fc2d61a4feb2fd82b281/crypt-fix.sh and sudo bash ./crypt-fix.sh. You may need to edit the DEVICE variable to reflect your disk and partition layout (this was created on an EFI system using LUKS and LVM). It will prompt you for your disk password once to mount and discover the correct name for the encrypted volume mount and then prompt again to mount with the correct name so that the update-initramfs command succeeds with the appropriate mapping, if this wasn't done you would get a warning and your next boot would still fail.

@makario
makario / NotificationTest.java
Created July 16, 2014 15:09
Displaying custom notifications for Android Wear
package com.makario.wearplay;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableString;