Skip to content

Instantly share code, notes, and snippets.

@DonRichards
DonRichards / vagrantFile.md
Last active December 29, 2022 13:33
Conditional Vagrant environments

Conditional Vagrant environments

2 options to start vagrant

command line with pass-through variable or alias

Run while passing variable to vagrantfile

$ ENV='local' vagrant up 

Add an alias

@itod
itod / split_keyboards.md
Last active April 27, 2026 08:29
Every "split" mechanical keyboard currently being sold that I know of
@mojavelinux
mojavelinux / jdk-install-path.sh
Created January 8, 2017 03:33
A portable way to get the install path of the current JDK.
#!/bin/sh
jrunscript -e 'print(java.lang.System.getProperty("java.home").replaceAll("\\"+java.io.File.separator+"jre$",""))'
@mm--
mm-- / org-refile-hydra.el
Created March 9, 2017 21:52
Hydra for quickly refiling Org mode entries
;; Adapted from https://emacs.stackexchange.com/questions/8045/org-refile-to-a-known-fixed-location
(defun my/refile (file headline &optional arg)
"Refile to a specific location.
With a 'C-u' ARG argument, we jump to that location (see
`org-refile').
Use `org-agenda-refile' in `org-agenda' mode."
(let* ((pos (with-current-buffer (or (get-buffer file) ;Is the file open in a buffer already?
(find-file-noselect file)) ;Otherwise, try to find the file by name (Note, default-directory matters here if it isn't absolute)
[core]
excludesfile = ~/.gitignore_global
pager = diff-so-fancy | less --tabs=4 -RFX
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[alias]
aa = add --all
@thomasdarimont
thomasdarimont / KeycloakAdminClientExample.java
Last active February 8, 2026 14:01
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@tasshin
tasshin / weeklyreviewtemplate.org
Last active December 14, 2023 19:50
Weekly Review Template

Weekly Review

Get Clear [0/5]

  • [ ] Collect Loose Papers and Materials
  • [ ] Get “IN” to Zero
    • [ ] Papers
    • [ ] Physical Notebook
    • [ ] Physical Objects
    • [ ] Text Messages
    • [ ] Voice Mail
    • [ ] Email Inboxes
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 3, 2026 15:07
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

;; see https://github.com/lolownia/org-pomodoro
;; and use case from http://headhole.org/organisation/2012/08/22/org-mode-gtd-and-the-pomodoro-technique/
(use-package org-pomodoro
:config
(global-set-key (kbd "M-<f11>") 'org-pomodoro)
(global-set-key (kbd "s-<f11>") 'org-pomodoro)
;; (global-set-key (kbd "C-c C-x C-i") 'org-pomodoro)
;; (global-set-key (kbd "C-c C-x C-o") 'org-pomodoro)
@ufuk
ufuk / AsyncConfiguration.java
Last active December 10, 2022 21:43
The easy way to disable @ Async annotation for test contexts. Same approach can be used to disable @ Scheduled annotation as well.
package ...configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableAsync;
@Configuration
@EnableAsync
@Profile("!test")
public class AsyncConfiguration {