Skip to content

Instantly share code, notes, and snippets.

View damashe's full-sized avatar

Damashe Thomas damashe

  • Tuscaloosa Alabama
View GitHub Profile
@damashe
damashe / licence activation.php
Created August 11, 2019 20:57 — forked from mattradford/licence activation.php
ACF5 Pro licence activation. Could be adapted for any other plugin that requires a licence key, but doesn't yet support defining it in wp-config. Fires on theme activation.
// Place this in wp-config
define( 'ACF_5_KEY', 'yourkeyhere' );
// Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
function auto_set_license_keys() {
if ( ! get_option( 'acf_pro_license' ) && defined( 'ACF_5_KEY' ) ) {
$save = array(
'key' => ACF_5_KEY,
@damashe
damashe / fd-clear-elementor-cache.php
Created April 23, 2019 21:33 — forked from heyfletch/fd-clear-elementor-cache.php
Clear Elementor Cache After a WP Migrate DB Pro Migration - Must Use Plugin (mu-plugins)
<?php
/*
Plugin Name: Clear Elementor Cache After WP Migrate DB Migration
Plugin URI: https://gist.github.com/heyfletch/769c64ad1fab8679032b076433afafd1
Description: Deletes CSS in uploads/elementor/css, which auto-regenerates on pageload. This clears the cache locally and remotely. Must-use plugin (mu-plugin).
Author: Fletcher Digital
Version: 0.1
Author URI: https://fletcherdigital.com
*/
@damashe
damashe / wp-update-plugins-git.sh
Created April 5, 2019 03:01 — forked from markjaquith/wp-update-plugins-git.sh
Update all WordPress plugins using WP-CLI and make a separate git commit for each one
#!/bin/bash
PLUGINS=$(wp plugin list --update=available --field=name | tr -d '\r');
wp plugin update-all;
for plugin in $PLUGINS; do
git add -A "wp-content/plugins/$plugin";
git commit -m "Update plugin: $plugin";
done;
@damashe
damashe / binds_on_mount.sh
Created November 5, 2018 22:53 — forked from alexandrusavin/binds_on_mount.sh
Add letsencrypt certificate to dd-wrt web interface
#!/bin/sh
if [ `nvram get https_enable` -gt 0 ] ; then
# get the absolute directory of the executable
SELF_PATH=$(cd -P "$(dirname "$0")" && pwd -P)
echo SELF_PATH: ${SELF_PATH}
# extract the mount path

Keybase proof

I hereby claim:

  • I am damashe on github.
  • I am damashe (https://keybase.io/damashe) on keybase.
  • I have a public key whose fingerprint is D268 E67B 27A5 08EB EDE8 8386 6D65 865D 29B1 7F36

To claim this, I am signing this object:

@damashe
damashe / .bash_profile
Created April 11, 2018 01:50 — forked from janmoesen/.bash_profile
Temporary .bash_profile
# ============== shell
# Case-insensitive globbing.
shopt -s nocaseglob;
# Do not overwrite files when redirecting using ">", ">&" or "<>".
# Note that you can still override this with ">|".
set -o noclobber;
# UTF-8 all the way.
export LC_ALL='en_GB.UTF-8';

How to get Composer running on SiteGround shared

  1. Download getcomposer.org/composer.phar to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!
@damashe
damashe / disable.sh
Created January 15, 2018 17:23
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
@damashe
damashe / searchlink.rb
Created December 18, 2017 01:48 — forked from ttscoff/searchlink.rb
SearchLink creates Markdown links from automatic searches based on special syntax.
@damashe
damashe / ck_form.css
Created December 9, 2017 22:31 — forked from nathanbarry/ck_form.css
One line form
.ck_form.single_line {
background: #f9f9f9;
font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif;
line-height: 1.5em;
overflow: hidden;
color: #666;
font-size: 16px;
border: solid 1px #d1d1d1;
-webkit-box-shadow: none;
-moz-box-shadow: none;