Skip to content

Instantly share code, notes, and snippets.

View JacobDB's full-sized avatar

Jacob Bearce JacobDB

View GitHub Profile
@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 / 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 / .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 / renew-letsencrypt.sh
Created November 16, 2018 17:08
Simple bash script to disable UFW, renew Lets Encrypt certificates, restart GitLab nginx, and re-enable UFW
ufw disable
certbot renew --renew-hook "/usr/bin/gitlab-ctl restart nginx"
ufw --force enable
@JacobDB
JacobDB / install-acf.sh
Last active July 23, 2024 10:28
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} "https://connect.advancedcustomfields.com/v2/plugins/download?p=pro&k=$ACF_KEY"
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
@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
<?php
/**
* Read ACF fields from JSON
*/
function PREFIX_acf_register_json_fields() {
if (function_exists("acf_add_local_field_group")) {
$acf_json_data = locate_template("path/to/advanced-custom-fields.json");
$custom_fields = $acf_json_data ? json_decode(file_get_contents($acf_json_data), true) : array();
foreach ($custom_fields as $custom_field) {
@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:[email protected]/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 / 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 {