Skip to content

Instantly share code, notes, and snippets.

View timnolte's full-sized avatar

Tim Nolte timnolte

View GitHub Profile
@agriffis
agriffis / .vimrc
Created February 25, 2019 12:53
neovim clipboard provider for tmux and OSC 52
function! ClipboardCopy(lines, regtype)
let sum = TryClipboardCmd('md5sum', a:lines)
call writefile(sum, s:regtype_sum, 'S')
call writefile([a:regtype], s:regtype_txt, 'S')
return TryClipboardCmd('clipboard-provider copy', a:lines)
endfunction
function! ClipboardPaste()
let lines = TryClipboardCmd('clipboard-provider paste')
let regtype = 'V'
@igorbenic
igorbenic / clauses.php
Last active May 20, 2026 07:31
Extending WP_Query with Custom Queries and Tables | https://www.ibenic.com/extending-wp-query-custom-queries-tables
<?php
add_filter( 'posts_clauses', 'filter_clauses', 10, 2 );
/**
* Filtering everything.
*
* @param array $clauses Array with all parts of the query.
* @param WP_Query $wp_query Object.
* @return string
@akiross
akiross / cifs_automount.md
Last active July 6, 2026 07:33
Automatically mount shared windows folders at boot on linux w/ systemd

Automount of CIFS (smbfs) folders w/ systemd

i.e. mounting your Windows shares on Linux at boot

First, let's see how to mount the remote directory. Assume that there is a shared folder over the network at \\192.168.1.1\users\self\shared which is accessible with user myuser and password secret123.

We could mount it manually in /mnt/winshare with:

# mount -t cifs //192.168.1.1/users/self/shared /mnt/winshare -o user=myuser,password=secret123

This should work on your Linux box, because systemd will basically call mount with the same arguments: What (//192.168.1.1/users/self/shared), Where (/mnt/winshare) and Options (user=myuser,password=secret123).

Your First Block

To make things simple, we're going to make a semi-structured way to display a mailing address.

We're going to start with a file tree that looks like this:

address-block
  ├ blocks
  | ├ address.jsx
@jdhao
jdhao / autocommands.vim
Last active July 29, 2022 17:18
My Neovim configurations for both terminal and gui (using nvim-qt). Repo: https://github.com/jdhao/nvim-config
"{ Auto commands
" Do not use smart case in command line mode,
" extracted from https://goo.gl/vCTYdK
augroup dynamic_smartcase
autocmd!
autocmd CmdLineEnter : set nosmartcase
autocmd CmdLineLeave : set smartcase
augroup END
" Set textwidth for text file types
@krisleech
krisleech / renew-gpgkey.md
Last active August 3, 2026 23:39
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@tjpalanca
tjpalanca / .crostini-setup
Last active February 3, 2023 00:17
Crostini Setup
These scripts set up Crostini on my Pixelbook
@carry0987
carry0987 / RPi3-Disable-Bluetooth-Or-WiFi-By-Default.md
Created July 30, 2018 13:42
RPi3-Disable-Bluetooth-Or-WiFi-By-Default

RPi3 Disable Bluetooth Or WiFi By Default

Step

  1. Use sudo mount /dev/mmcblk0p1 /mnt to mount SD Card

  2. Use sudo vim /mnt/config.txt to edit config

  3. Disable WiFi

@djrmom
djrmom / custom-hooks.php
Created April 3, 2018 16:56
facetwp jetpack lazy load compat
<?php
/** reinitializing jetpack's lazy load after facet loads **/
add_action( 'wp_head', function() {
?>
<script>
(function($) {
$(document).on('facetwp-loaded', function() {
jetpackLazyImagesModule( $ );
});
@santrancisco
santrancisco / VagrantFile
Created March 19, 2018 00:55
VagrantFile for official base image - windows 10 with Microsoft edge
# -*- mode: ruby -*-
# vi: set ft=ruby :
## Thanks to the discussion of various developers in this gist
## https://gist.github.com/andreptb/57e388df5e881937e62a#gistcomment-2346821
## Especially clement-igonet.
### How to get Windows10 with Edge official base image run with WinRM and RDP:
# To use Windows10-Edge vagrant you will first need to download https://aka.ms/msedge.win10.vagrant (this is now a zip file)
# Execute `vagrant box add ./MsEdge\ -\ Win10.box --name Win10-official` after unzip the file to add the box to our base image list