Skip to content

Instantly share code, notes, and snippets.

Jacob Bearce JacobDB

Block or report user

Report or block JacobDB

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:69abafedee7df48b7eea7f0fbf3e42eb
nativefier --name "Android Messages" --tray --single-instance --icon icon.png "https://messages.android.com"
@JacobDB
JacobDB / config.js
Last active Apr 14, 2018
Why does this task not work when I put everything directly in a promise?
View config.js
// 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 Mar 26, 2018
Configuration file to use Node LTS with NVM
@JacobDB
JacobDB / code.sh
Last active Feb 13, 2019
Alias used to open Visual Studio Code from within Bash on WSL.
View code.sh
code() {
target_path=$(wslpath -a -w $(readlink -f $1)) # resolve the path
(/mnt/c/Windows/System32/cmd.exe /C "Code $target_path" &> /dev/null) # open the path
}
@JacobDB
JacobDB / custom-nav-menus-options.php
Last active Apr 2, 2018
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.
View custom-nav-menus-options.php
<?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 Jun 23, 2017
Small script to fix web permissions
View fix-web-permissions.sh
#!/bin/bash
directory=$1
if [ "$directory" == "" ]
then
echo -e $"${0##*/}: missing operand"
exit 1;
fi;
if ! [[ -r "$directory" && -w "$directory" ]]
@JacobDB
JacobDB / alt-arrow-home-end.ahk
Last active Jun 17, 2017
Remap !→ to "End" and !← to "Home" to make switching between Mac & Windows easier
View alt-arrow-home-end.ahk
!Left::
Send, {Home}
Return
!Right::
Send, {End}
Return
@JacobDB
JacobDB / navigation.html
Created Apr 30, 2017 — forked from danblakemore/navigation.html
Nested Jekyll page navigation without plugins
View navigation.html
{% capture html %}
{% assign childCount = '' %}
{% comment %} Make sure there will be pages before making the ul tag. {% endcomment %}
{% assign entries = site.pages | sort: "path" %}
{% for entry in entries %}
{% capture slug %}{{ entry.url | split: "/" | last }}{% endcapture %}
{% capture current %}{{ entry.url | remove: slug | remove: "//" | append: "/" }}{% endcapture %}
{% if current == include.context %}
@JacobDB
JacobDB / install.sh
Created Apr 26, 2017
Install Jekyll on WSL
View install.sh
sudo apt-get install ruby ruby-dev gcc
sudo gem install jekyll bundler
@JacobDB
JacobDB / config.php
Last active Apr 24, 2017
Example settings for triggering a gulp task when using https://github.com/vicenteguerra/git-deploy
View config.php
<?php
define('TOKEN', 'some-secret-token');
define('REMOTE_REPOSITORY', 'git@github.com:username/repository.git');
define('DIR','/var/www/repository/');
define('BRANCH','refs/heads/master');
define('LOGFILE', 'log.txt');
define('GIT', '/usr/bin/git');
define('AFTER_PULL', '/usr/bin/node ./node_modules/gulp/bin/gulp.js default --dist');
You can’t perform that action at this time.