Skip to content

Instantly share code, notes, and snippets.

View JacobDB's full-sized avatar

Jacob Bearce JacobDB

View GitHub Profile
@JacobDB
JacobDB / .scripts.log
Created April 10, 2019 13:38
Log of output of `.scripts` for VS Code Chrome Debugger debugging https://github.com/Microsoft/vscode-chrome-debug/issues/802
.scripts
› VM83
› VM84
› http://framework.localhost
› http://framework.localhost/wp-content/themes/framework/assets/scripts/fontawesome.cc84fb87.js (c:\Users\Jacob\Repositories\new-site\dev\assets\scripts\fontawesome.cc84fb87.js)
› http://framework.localhost/wp-content/themes/framework/assets/scripts/modern.08943789.js (c:\Users\Jacob\Repositories\new-site\dev\assets\scripts\modern.08943789.js)
› webpack:///(webpack)/buildin/module.js
› webpack:///./node_modules/@dotsunited/load-css-polyfill/dist/load-css-polyfill.mjs
› webpack:///./node_modules/@fortawesome/fontawesome-svg-core/index.es.js
@JacobDB
JacobDB / init.php
Created July 19, 2019 14:39
Initialization script for git-deploy
<?php
define("TOKEN", "g430vdsj07jDSFj93g21");
define("REMOTE_REPOSITORY", "https://gitlab+deploy-token-123:g430vdsj07jDSFj93g21@gitlab.com/JacobTheDev/new-site.git");
define("DIR", "{$_SERVER["DOCUMENT_ROOT"]}/.gitlab/repository/");
define("BRANCH", "refs/heads/master");
define("LOGFILE", "deploy.log");
define("GIT", "/usr/bin/git");
define("MAX_EXECUTION_TIME", 180);
define("BEFORE_PULL", "");
define("AFTER_PULL", "");
@JacobDB
JacobDB / wkqx.php
Created March 15, 2016 19:26
Web scraper to convert TuneGenie in to RSS
<?php
$url = "http://wkqx.tunegenie.com/";
$title = "WKQX RSS Feed";
$description = "A constantly updated feed for WKQX's playlist";
$userAgent = "Googlebot/2.1 (http://www.googlebot.com/bot.html)";
header("Content-type: text/xml; charset=utf-8", true);
echo "<?xml version='1.0' encoding='UTF-8' ?>" . PHP_EOL;
echo "<rss version='2.0'>" . PHP_EOL;
@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
@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 / twitch.sh
Created August 24, 2020 15:37
Download Twitch VODs
#!/bin/sh
# To find proper value for $1, open a developer tools on a Twitch stream and select "Network." Search for "m3u8," copy the longest URL you see, and it should work.
ffmpeg -i $1 -c copy -bsf:a aac_adtstoasc $2
@JacobDB
JacobDB / auto-nvm.sh
Created April 14, 2021 16:09
Automatically switch NVM versions when entering directories which contain `.nvmrc`
#!/bin/bash
# Run 'nvm use' automatically every time there's a .nvmrc file in the directory.
# Also, revert to default version when entering a directory without .nvmrc
enter_directory() {
if [[ $PWD == $PREV_PWD ]]; then
return
fi
PREV_PWD=$PWD
@JacobDB
JacobDB / install-acf.sh
Last active November 18, 2021 15:01
Download and install ACF Pro via a bash script – to be used with WP CLI. Set an environemnt variable ACF_KEY first!
#!/bin/sh
# Adapted from https://support.advancedcustomfields.com/forums/topic/download-acf-with-wp-cli-on-clean-install/#post-26191
# get plugin path
acf_zip_file="$(wp plugin path)/advanced-custom-fields-pro.zip"
# get acf zip file
wget -O ${acf_zip_file} "http://connect.advancedcustomfields.com/index.php?p=pro&a=download&k=$ACF_KEY"
@JacobDB
JacobDB / focus-assist-toggle.ahk
Last active February 13, 2022 12:57
Focus assist toggle with WIN+SHIFT+F
active := false
+#F::
SendInput, {LWin down}b{LWinUp}{Left}
SendInput, {APPSKEY}{Down}{Down}{Enter}
if (active = false) {
SendInput, {Down}{Down}
active := true
} else {
@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;
}