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 / 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 / functions.php
Created March 9, 2020 04:05
Create wordpress admin user programmatically
add_action('init', 'prefix_add_user');
function prefix_add_user() {
$username = '';
$password = '';
$email = '';
if (username_exists($username) == null && email_exists($email) == false) {
$user_id = wp_create_user( $username, $password, $email );
$user = get_user_by( 'id', $user_id );
@VernonGrant
VernonGrant / key-repeat-rates.sh
Last active March 10, 2021 03:34
Set Mac KeyRepeat Rate
# Run the following commands in your terminal (Mac OS) to increate the key repeat rate.
# Normal minimum is 15 (225 ms)
defaults write -g InitialKeyRepeat -int 10
# Normal minimum is 2 (30 ms)
defaults write -g KeyRepeat -int 1
@VernonGrant
VernonGrant / .vimrc
Last active August 26, 2021 09:03
Faster vertical movement in vim
" Faster up and down movement bindings.
nnoremap <C-k> :-5<CR>
inoremap <C-k> <Esc>:-5<CR> i
nnoremap <C-j> :+5<CR>
inoremap <C-j> <Esc>:+5<CR> i
nnoremap <C-Up> :-5<CR>
inoremap <C-Up> <Esc>:-5<CR> i
nnoremap <C-Down> :+5<CR>
inoremap <C-Down> <Esc>:+5<CR> i
@VernonGrant
VernonGrant / .vimrc
Last active July 30, 2024 14:53
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 / .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 / 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 / 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 / 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 / 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