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
dojo.addOnLoad(function(){
dijit.registry.byClass("dijit.form.DateTextBox").forEach(function(w){
if(w.class == 'hugDatePicker'){
w.validator = function(value, constraints){
var deferred = isValidDate(value);
return deferred.then(function(value){
@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();
}
/**
<?php
class MY_Exceptions extends CI_Exceptions {
function My_Exceptions()
{
parent::CI_Exceptions();
}
function log_exception($severity, $message, $filepath, $line)
@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;
}
@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 / 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

[Unit]
Description=k8-etcd
Requires=docker.service
After=docker.service
BindsTo=docker.service
[Service]
User=root
TimeoutStartSec=0
Restart=always
@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'
# tmux cheatsheet
start new with session name:
tmux new -s myname
attach:
tmux a
@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>