Skip to content

Instantly share code, notes, and snippets.

View dbowling's full-sized avatar
🌱
Always learning.

Dan Bowling dbowling

🌱
Always learning.
View GitHub Profile
@dbowling
dbowling / sitemap.vm
Created March 4, 2022 17:43
Cascade velocity macro for sitemap.xml
## // TODO:
## <loc>https://www.umt.edu/academics/programs/_archive/questions/communication-studies/images/default.php</loc>
## // if not yet published
## // if last modified is greater than last published
## // create system tag to include in sitemap
## // create sitemap index https://www.sitemaps.org/protocol.html | https://moz.com/sitemaps-1-sitemap.xml
## // sitemap index can auto find all sitemaps in the domain by query tool
## // if not include in navigation, should we exclude from the sitemap?
## // changefreq value from metadata (or content type/direct path match e.g. homepage, news site)
## // priority from metadata (or content type)
@dbowling
dbowling / index.html
Created May 10, 2021 05:31 — forked from sarsamurmu/index.html
Lit CSS Plugin Snippet for Reboost JS
<html>
<head>
<script type="module" src="./build.js"></script>
</head>
<body>
<my-element></my-element>
</body>
</html>
# tmux cheatsheet
start new with session name:
tmux new -s myname
attach:
tmux a
@dbowling
dbowling / restic_backup_with_vss.ps1
Created May 4, 2018 16:31
PowerShell script to wrap Restic backup allowing Volume Shadow Copy.
#
# This script must be run with Administrator privs in order to create VSS snapshot!!!!
#
# Windows PowerShell Script to use restic to backup files using the Volume Shadow Copy Service, allowing
# that are in use to be backed up. The script must be run with elevated privileges.
# The Volume Shadow Copy Service must be enabled for the disk volume that contains the files to be backed up.
#
# Parameters
$resticExe = 'C:\bin\restic.exe'
$resticRepository = 'b2:bucket-name:folder'
[Unit]
Description=k8-etcd
Requires=docker.service
After=docker.service
BindsTo=docker.service
[Service]
User=root
TimeoutStartSec=0
Restart=always
@dbowling
dbowling / launch_sublime_from_terminal.markdown
Created July 6, 2012 03:57 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@dbowling
dbowling / gist:2589645
Created May 3, 2012 21:25
Convert text to a valid CSS class name
string = 'Invalid C$$ class name';
string.replace(/[!\"#$%&'\(\)\*\+,\.\/:;<=>\?\@\[\\\]\^`\{\|\}~]/g, '').toLowerCase();
@dbowling
dbowling / gist:1567899
Created January 5, 2012 23:14
Folder authentication with reverse proxy via NGINX
location / {
try_files $uri @proxy;
}
location ~ (/sait/.*|/vpsa/.*) {
auth_basic "Restricted";
auth_basic_user_file passwords/test;
try_files $uri @proxy;
}
<?php
class MY_Exceptions extends CI_Exceptions {
function My_Exceptions()
{
parent::CI_Exceptions();
}
function log_exception($severity, $message, $filepath, $line)
@dbowling
dbowling / MY_Form_Validation.php
Created December 14, 2011 21:47
Custom form validation subclass
<?php
class MY_Form_Validation extends CI_Form_validation {
public function __construct()
{
parent::__construct();
}
/**