Skip to content

Instantly share code, notes, and snippets.

View JacobDB's full-sized avatar

Jacob Bearce JacobDB

View GitHub Profile
@JacobDB
JacobDB / .htaccess
Last active November 9, 2018 15:25
Clone a repository, generate a symlink, and protect the deployment folder for use with git-deploy – https://github.com/vicenteguerra/git-deploy
Order Allow,Deny
Deny from all
<Files "deploy.php">
Allow from all
</Files>
@JacobDB
JacobDB / ssh-on-wsl.md
Created October 29, 2018 22:53
Setting up SSH Server on WSL
  1. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  2. chmod 700 ~/.sssh
  3. chmod 600 ~/.ssh/auhotirzed_keys
@JacobDB
JacobDB / wp-login.scss
Created September 24, 2018 15:35
Default login styles for WordPress along with color functions to easily change the theme
$base: #0085BA;
$tint: lighten(desaturate(adjust-hue($base, 1.6532), 27.2727), 6.6667);
$shade: darken(adjust-hue($base, 2.5111), 6.4706);
input:focus {
border-color: #5b9dd9; // @NOTE lighten(desaturate(adjust-hue($base, 11.4747), 37.6238), 23.9216)
box-shadow: 0 0 2px rgba(30,140,190,.8); // @NOTE transparentize($tint, 0.2)
}
input[type="checkbox"]:checked::before {
@JacobDB
JacobDB / getftpjson.sh
Created September 19, 2018 16:06
Simple script to quickly get my ftp.json for older sites; place in /usr/local/bin
#!/bin/bash
curl -LOk https://gist.githubusercontent.com/JacobDB/a04f5ba7e00b267e71e2/raw/254fa0ae3545106f038af28d7d8ab30a440b2c0e/ftp.json
nativefier --name "Android Messages" --tray --single-instance --icon icon.png "https://messages.android.com"
@JacobDB
JacobDB / config.js
Last active April 14, 2018 22:20
Why does this task not work when I put everything directly in a promise?
// JavaScript Document
// Scripts written by __gulp_init__author_name @ __gulp_init__author_company
module.exports = {
// config task, generate configuration file for uploads & BrowserSync and prompt dev for input
config(gulp, plugins, requested = "") {
// generate config.json and start other functions
const generate_config = (file_name, mode = "ftp") => {
// store array of config file URIs
@JacobDB
JacobDB / .nvmrc
Created March 26, 2018 21:41
Configuration file to use Node LTS with NVM
lts/*
@JacobDB
JacobDB / code.sh
Last active April 24, 2020 15:28
Small script to fix symlinked paths when opening VS Code from within WSL
# Modify VS Code CLI to expand symlinks before opening, to fix git status highlighting
code() {
# Set the path to VS Code
code_path="/mnt/c/Users/Jacob/AppData/Local/Programs/Microsoft VS Code/bin/code";
# Store converted arguments
converted=""
# Loop through all passed arguments
for arg in "$@"
@JacobDB
JacobDB / custom-nav-menus-options.php
Last active June 9, 2023 06:36
Add any custom option to the WordPress nav menus editor. I primarily use this for mega menus, but it can be used to add basically any additional data to menus.
<?php
// add custom options to the menu editor
if (is_admin() && $pagenow === "nav-menus.php") {
// include this so we can access Walker_Nav_Menu_Edit
require_once ABSPATH . "wp-admin/includes/nav-menu.php";
// Add the WordPress color picker styles & scripts
function new_site_nav_menu_color_picker() {
wp_enqueue_style("wp-color-picker");
wp_enqueue_script("wp-color-picker");
@JacobDB
JacobDB / fix-web-permissions.sh
Last active June 23, 2017 16:11
Small script to fix web permissions
#!/bin/bash
directory=$1
if [ "$directory" == "" ]
then
echo -e $"${0##*/}: missing operand"
exit 1;
fi;
if ! [[ -r "$directory" && -w "$directory" ]]