Skip to content

Instantly share code, notes, and snippets.

View mchowning's full-sized avatar

Matt Chowning mchowning

View GitHub Profile
@hypest
hypest / redux-store_index.js
Last active May 17, 2022 14:40
Gutenberg Redux action logger
function createSimpleLogger( storeName ) {
return ( store ) => ( next ) => ( action ) => {
const result = next( action );
console.log( {
storeName,
action,
result,
} );
return result;
};
@SirensOfTitan
SirensOfTitan / title-override.el
Created July 14, 2021 19:38
Org-roam titles that denote daily
(defun sirensoftitan/org-roam--is-daily-note (path)
"Determine if note at PATH is a daily note."
(when org-roam-dailies-directory
(string-prefix-p
(expand-file-name org-roam-dailies-directory)
(expand-file-name path))))
(defun sirensoftitan/org-roam--map-title (item)
"Map ITEM to a local title name."
(let* ((file-path (nth 1 item))
@geriux
geriux / patch.diff
Created June 24, 2021 13:04
Add redux logger
diff --git a/package.json b/package.json
index 5ca465469c..9596f57c16 100644
--- a/package.json
+++ b/package.json
@@ -80,7 +80,8 @@
"@wordpress/viewport": "file:packages/viewport",
"@wordpress/warning": "file:packages/warning",
"@wordpress/widgets": "file:packages/widgets",
- "@wordpress/wordcount": "file:packages/wordcount"
+ "@wordpress/wordcount": "file:packages/wordcount",
@alshakero
alshakero / tampermonkey-copy-text-fragment-url.user.js
Created May 27, 2020 15:02
Adds a context menu option to copy the text fragment URL
// ==UserScript==
// @name Copy text fragment URL
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Copies the text fragment URL for you
// @author Omar Alshaker (@alshakero)
// @include *
// @grant GM.setClipboard
// @run-at context-menu
// ==/UserScript==
@watofundefined
watofundefined / syncthing-git-backup.md
Last active December 8, 2023 03:02
Syncthing git backup recipe

Syncthing has awesome docs - start there if you haven't read them already. This is just a recipe to show how I set it up to have a git-versioned backup on Raspberry Pi.

Once machines are talking to each other via Syncthing add the folder through GUI, share it with another device, switch to that device and accept the incoming folder.

Let's say that the folder is ~/org.

On the 'backup' device in Syncthing GUI, go to Folder settings > File Versioning, choose "External File Versioning" and in Command input fill in: git-backup-org %FOLDER_PATH% %FILE_PATH%.

On the 'backup' device create the backup folder and initialize a git repository:

@ChrisPenner
ChrisPenner / Optics Cheatsheet.md
Last active April 12, 2024 14:24
Optics Cheatsheet
@snoyberg
snoyberg / README.md
Last active August 27, 2018 05:57
Miniature Haskell interactive environment for my kids to play around with
@brookisme
brookisme / gcloud-gpu-setup.sh
Last active February 24, 2018 05:01
Google Cloud GPU Setup: Instructions & bash-script
#!/bin/bash
cd ~/
### CUDA
echo "\n\nChecking for CUDA and installing."
if ! dpkg-query -W cuda; then
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda -y
@JakeWharton
JakeWharton / gist:f50f3b4d87e57d8e96e9
Created February 7, 2015 01:59
Rise and Shine™, unlock and wake up your device automatically when you deploy from the IDE. Put this somewhere in your `src/debug/` code and run it when the application or main activity starts. Apache 2.
/**
* Show the activity over the lockscreen and wake up the device. If you launched the app manually
* both of these conditions are already true. If you deployed from the IDE, however, this will
* save you from hundreds of power button presses and pattern swiping per day!
*/
public static void riseAndShine(Activity activity) {
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED);
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE);
PowerManager.WakeLock lock =
@staltz
staltz / introrx.md
Last active May 18, 2024 05:17
The introduction to Reactive Programming you've been missing