Skip to content

Instantly share code, notes, and snippets.

View bdaley's full-sized avatar

Brian Daley bdaley

View GitHub Profile
@bdaley
bdaley / mirror.sh
Last active July 8, 2020 00:37
Mirror a website with wget
# Mirror Site
# Add --span-hosts to include remote assets
wget -P [directory_name] --mirror --html-extension --no-parent --convert-links --user-agent="" -e robots=off --wait 1 -E https://example.com/
@bdaley
bdaley / large-files.sh
Created May 12, 2020 00:27
Find large files in unix/linux
find / -xdev -type f -size +100M -print | xargs ls -lh | sort -k5,5 -h -r
@bdaley
bdaley / Dockerfile
Created May 15, 2019 17:39
Simple Docker Setup for PHP
FROM php:7.3.5-cli-stretch
RUN docker-php-ext-install mysqli
@bdaley
bdaley / url-maker-for-blackboard.user.js
Last active December 17, 2018 19:18
Makes student assignment links clickable in Blackboard
// ==UserScript==
// @name URL Maker for Blackboard
// @namespace https://lms.uconn.edu/webapps/assignment/
// @version 0.2
// @description Makes links clickable
// @author Brian Daley <[email protected]>
// @match https://lms.uconn.edu/webapps/assignment/*
// @grant none
// @downloadUrl https://gist.github.com/bdaley/b0c1a3c36111b4e620c71981ebb83b7b/raw/url-maker-for-blackboard.user.js
// @updateUrl https://gist.github.com/bdaley/b0c1a3c36111b4e620c71981ebb83b7b/raw/url-maker-for-blackboard.user.js
@bdaley
bdaley / woocommerce-settings-tab-demo.php
Created January 20, 2018 00:48 — forked from BFTrick/woocommerce-settings-tab-demo.php
A plugin demonstrating how to add a WooCommerce settings tab.
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@bdaley
bdaley / wc-regenerate-and-notify.php
Last active July 28, 2021 00:02
Adds an action to the order page that allows you to regenerate download permissions AND extends the expiration date for WooCommerce downloads.
<?php
add_filter('woocommerce_order_actions', 'wc_regenerate_and_notify_custom_order_action');
function wc_regenerate_and_notify_custom_order_action( $actions ) {
// Remove the woocommerce option to regenerate to avoid confusion
unset($actions['regenerate_download_permissions']);
// Add our new action (executed below)
$actions['wc_regenerate_and_notify'] = __('Regenerate permissions & send link to customer', 'wc-regenerate-and-notify');
return $actions;
@bdaley
bdaley / current-theme.php
Last active October 4, 2017 02:56
WordPress: Show Current Theme Template
<?php if(current_user_can( 'manage_options' )): ?>
<!-- A little help for admin users + devs :) -->
<div style="position:fixed;width:100vw;color:#fff;background-color:rgba(0,0,0,.8);z-index:1000;bottom:0;padding:1em;">Theme Template: <?php global $template; echo basename($template); ?></div>
<?php endif; ?>
@bdaley
bdaley / SassMeister-input-HTML.html
Created November 12, 2015 20:20
Generated by SassMeister.com.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SASS Media Queries</title>
<meta name="description" content="A short exercise to demo media queries in SASS">
</head>
<body>
<main>
@bdaley
bdaley / bash-cheatsheet.sh
Created October 20, 2015 02:04 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@bdaley
bdaley / wp_bookmarklet.js
Created January 7, 2015 19:15
WordPress Shortlink Bookmarklet
javascript:(function($){window.prompt('Please copy the short link and press ok',$('link[rel="shortlink"]').attr('href'));})(jQuery);