Skip to content

Instantly share code, notes, and snippets.

View DArcMattr's full-sized avatar
🍕

David Arceneaux DArcMattr

🍕
View GitHub Profile
if !1 | finish | endif
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
if system('uname -o') =~ '^GNU/'
let b:make = 'make'
@DArcMattr
DArcMattr / llvm-update-alternatives.sh
Created October 9, 2017 22:06
Make clang & llvm 4.0 usable on Ubuntu
#!/usr/bin/env sh
sudo update-alternatives --install \
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-4.0 200 \
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-4.0 \
--slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-4.0 \
--slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-4.0 \
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-4.0 \
--slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-4.0 \
--slave /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-4.0 \
@DArcMattr
DArcMattr / .ctags
Last active September 14, 2019 18:24
Universal Ctags configuration for WordPress action & filter hooks. Adapted from work done by @dsawardekar
--regex-PHP=/^do_action(_deprecated|_ref_array)?\s*\(\s*['"]([a-z_]+)['"]\s*.*$/4c710n_\1/A,action/
--regex-PHP=/^add_action\s*\(\s*['"]([a-z_]+)['"]\s*.*$/4l1573n3r_\1/L,alistener/
--regex-PHP=/^apply_filters(_deprecated|_ref_array)?\s*\(\s*['"]([a-z_]+)['"]\s*.*$/ph1l73r_\1/R,filter/
--regex-PHP=/^add_filter\s*\(\s*['"]([a-z_]+)['"]\s*.*$/phl1573n3r_\1/E,flistener/
#!/bin/sh
# Usage: either edit for your local, or:
# WP_HOME=/var/www/wordpress SITE_DIR=/var/www/foobar.example/htdocs ./ln-wp.sh
WP_HOME="${WP_HOME:=/srv/www/wordpress}"
SITE_DIR="${SITE_DIR:=/srv/www/example.com/htdocs}"
ln -s "${WP_HOME}/wp-admin" "${SITE_DIR}/wp-admin"
ln -s "${WP_HOME}/wp-includes" "${SITE_DIR}/wp-includes"
ln -s "${WP_HOME}/wp-activate.php" "${SITE_DIR}/wp-activate.php"
muplugins_loaded
pre_site_option_siteurl
default_site_option_siteurl
pre_option_siteurl
option_siteurl
site_option_siteurl
pre_option_home
option_home
register_taxonomy_args
gettext_with_context
@DArcMattr
DArcMattr / .inputrc
Last active September 10, 2016 20:02
Config for Readline feature
# Two escapes clears command line
"\e\e": "\C-a\C-k"
"\t": menu-complete
set keymap vi
set editing-mode vi
$if mode=vi
set keymap vi-command
set keymap vi-insert
<?php
/*
Plugin Name: Minimal Rest API
Description: Very minimal DIY REST API plugin scaffold, must refresh permalink
settings to get this to work
*/
/**
* WP Init Action hook function
*
#!/usr/bin/php
<?php // vim:ft=php
if ( ! isset( $argv[1] ) ) {
die( 'No number input given' );
}
$max = intval( $argv[1] );
for ( $i = 1; $i <= $max; $i++ ) {
$string = '';
#!/usr/bin/php
<?php // vim:ft=php
$max = intval( $argv[1] );
for ( $i = 1; $i <= $max; $i++ ) {
$string = '';
$string .= ( 0 === ( $i % 3 ) ) ? 'Fizz' : '';
$string .= ( 0 === ( $i % 5 ) ) ? 'Buzz' : '';
#showtooltip
/cancelform [nostance:0,mod:alt]
/console autounshift 0
/use Healing Touch
/console autounshift 1