Skip to content

Instantly share code, notes, and snippets.

View JacobDB's full-sized avatar

Jacob Bearce JacobDB

View GitHub Profile
@JacobDB
JacobDB / alt-arrow-home-end.ahk
Last active June 17, 2017 21:39
Remap !→ to "End" and !← to "Home" to make switching between Mac & Windows easier
!Left::
Send, {Home}
Return
!Right::
Send, {End}
Return
@JacobDB
JacobDB / navigation.html
Created April 30, 2017 14:56 — forked from danblakemore/navigation.html
Nested Jekyll page navigation without plugins
{% 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 April 26, 2017 22:45
Install Jekyll on WSL
sudo apt-get install ruby ruby-dev gcc
sudo gem install jekyll bundler
@JacobDB
JacobDB / config.php
Last active April 24, 2017 13:43
Example settings for triggering a gulp task when using https://github.com/vicenteguerra/git-deploy
<?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');
@JacobDB
JacobDB / open.sh
Last active September 27, 2018 20:08
Alias used to open File Explorer from within Bash on WSL.
open() {
target_path=$(wslpath -a -w $(readlink -f $1)) # resolve the path
/mnt/c/Windows/explorer.exe $target_path # open the path
}
@JacobDB
JacobDB / atom.sh
Last active February 13, 2019 15:42
Alias used to open Atom from within Bash on WSL.
atom() {
target_path=$(wslpath -a -w $(readlink -f $1)) # resolve the path
(/mnt/c/Windows/System32/cmd.exe /C "atom.cmd $target_path" &> /dev/null) # open the path
}
@JacobDB
JacobDB / inline-svg-function.scss
Created January 26, 2017 17:45 — forked from B-iggy/inline-svg-function.scss
Inline SVG function [SASS]
// Replace letters
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
}
@JacobDB
JacobDB / .gitlab-ci.yml
Last active March 10, 2020 13:38 — forked from RafalSladek/ .gitlab-ci.yml
gitlab ci file for gulp build pipeline with the latest nodejs
image: node:latest
cache:
paths:
- node_modules/
before_script:
- npm install -g gulp
- npm install
# Apache Server Configs v2.14.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html.
# ######################################################################
#!/bin/bash -ue
#Invoice Ninja Self-Hosted Update
#PLEASE SEE THE README AT https://pastebin.com/nwcSH0TH
#SET INVOICE NINJA INSTALL AND STORAGE PATHS
#--------------------------------------------------------
sudo updatedb
ninja_home="$(locate -b '\composer.json' | xargs grep -l "invoiceninja/invoiceninja" | xargs -n 1 dirname)"
ninja_storage="$ninja_home/storage"