Skip to content

Instantly share code, notes, and snippets.

View VernonGrant's full-sized avatar
🤓
Working @twothreebird

Vernon Grant VernonGrant

🤓
Working @twothreebird
View GitHub Profile
@VernonGrant
VernonGrant / example.js
Last active August 18, 2023 11:24
Root issue example, updating multiple block states.
const fetch = require("node-fetch");
const url =
"https://sandbox.uk.rootplatform.com/v1/insurance/claims/claim-id-here/blocks";
// This is incorrect:
let options = {
method: "PATCH",
headers: { accept: "application/json", "content-type": "application/json" },
body: JSON.stringify({
@VernonGrant
VernonGrant / init.el
Created March 30, 2023 08:15
Setup of Emacs's modus vivendi theme
;;;;;;;;;;;;;;;;;;;
;; Vivendi Theme ;;
;;;;;;;;;;;;;;;;;;;
(progn
(setq-default
modus-themes-mode-line '(accented borderless padded)
modus-themes-region '(accented bg-only)
modus-themes-paren-match '(bold intense)
modus-themes-bold-constructs nil
@VernonGrant
VernonGrant / .emacs
Created March 24, 2023 15:14
Zap up to char, but without the mini buffer prompt.
;; Zap up to char quickly.
(defun vg-quick-zap-up-to-char (p c)
"The same as zap up to char, but without the mini buffer prompt.
P: The prefix argument or the count.
C: The character to zap up to."
(interactive "P\nc")
(let ((cnt (cond ((null p) 1)
((symbolp p) -1)
(t p))))
(zap-up-to-char cnt c)))
@VernonGrant
VernonGrant / clojure-windows-cider.md
Last active November 29, 2022 05:02
Clojure via Cider and Emacs on Windows

Clojure/Cider on Windows

I spent the past 2 days trying to get this working and have tried almost everything I can think of, but I just can't get Cider functioning on Windows. I guess I'll need to use VSCode for now and this is truly painful :-(. Here's some of the guides I followed that didn't work. BTW I'm new to Clojure so I might have been doing something stupid.

Attempt One

Went to the official website's install Clojure section. Followed the Windows guide [clj

@VernonGrant
VernonGrant / scale-spotify.md
Created February 15, 2022 07:42
Scale snapd installed spotify on Ubuntu 21:10.

Scale Spotify on Ubuntu 21:10

  • Open the Spotify snapd desktop file at: /var/lib/snapd/desktop/applications/spotify_spotify.desktop.
  • Add --force-device-scale-factor=2.0 to the Exec line.
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/spotify_spotify.desktop /snap/bin/spotify --force-device-scale-factor=2.0 %U
@VernonGrant
VernonGrant / git.sh
Last active January 29, 2022 03:53
Correct WSL Git line endings issues.
# For the current repository
git config core.filemode false
# Globally
git config --global core.filemode false
@VernonGrant
VernonGrant / widgets.css
Last active April 21, 2021 06:39
WordPress Widgets
.widget { }
.widget-title {}
/* links widget */
.widget_links {}
.widget_links ul {}
.widget_links ul li {}
.widget_links ul li a {}
@VernonGrant
VernonGrant / lint-only-changed-files.MD
Created March 22, 2021 04:15 — forked from seeliang/lint-only-changed-files.MD
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

git diff --name-only master | grep -E "(.js$|.ts$|.tsx$)"

@VernonGrant
VernonGrant / .vimrc
Last active March 19, 2021 03:09
Vim run tasks
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" TASKS "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" holds the global tasks
let g:GlobalTasks = {'Git Status:': '!git status'}
fun GetNumberedDictKeys(taskDict)
" Extracts the task keys and returns them as a numbered list.
let counter = 1
@VernonGrant
VernonGrant / .vimrc
Last active November 19, 2023 14:55
Modifying Vim's Status Line
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" STATUSLINE "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
highlight VertSplit guibg=#181818 guifg=#996228
highlight SLBackground guibg=#181818 guifg=#996228
highlight SLFileType guibg=indianred guifg=#663333
highlight SLBufNumber guibg=SeaGreen guifg=#003333
highlight SLLineNumber guibg=#80a0ff guifg=#003366