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 / pint.sh
Created April 24, 2024 12:22 — forked from gabrielbidula/pint.sh
fake laravel pint formatter mode
#!/bin/bash
# Check if an argument was provided
if [ $# -eq 0 ]; then
echo "No file path provided."
exit 1
fi
# Use the provided argument (file path)
file="$1"
@VernonGrant
VernonGrant / import-db.sh
Last active March 22, 2024 10:48
Docker import database into mysql container
docker exec -i 276ae51c353e1 mysql -uusername -ppassword databasename < ../database.sql
@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
@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 / .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 / 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 / font_awesome_free_cheatsheet.php
Last active December 4, 2022 23:17
Font Awesome Free's Cheatsheet PHP
<?php
$icons = array(
'solid_icons' => array(
'ad' => 'f641',
'address-book' => 'f2b9',
'address-card' => 'f2bb',
'adjust' => 'f042',
'air-freshener' => 'f5d0',
'align-center' => 'f037',
@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 / functions.php
Last active March 25, 2022 05:48
Limiting chinese excerpts in WordPress.
<?php
/**
* Filters the excerpt to limit Chinese strings properly.
*
* @param string $excerpt The starting execerpt.
* @return string The new limited excerpt
*/
function prefix_filter_chinese_excerpt( $excerpt ) {
$limit = 80;
@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