Skip to content

Instantly share code, notes, and snippets.

View briceburg's full-sized avatar

Brice Burgess briceburg

  • toil over toil
  • albuquerque, nm
View GitHub Profile
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 30s;
.first_byte_timeout = 30s;
}
sub vcl_recv {
import XMonad
import XMonad.Actions.CycleWS -- cycle thru WS', toggle last WS
import XMonad.Hooks.DynamicLog -- statusbar
import XMonad.Hooks.ManageDocks -- dock/tray mgmt
import XMonad.Util.EZConfig -- append key/mouse bindings
import XMonad.Util.Run(spawnPipe) -- spawnPipe and hPutStrLn
import System.IO
import XMonad.Actions.SpawnOn
lowerVolume = "<XF86AudioLowerVolume>"
@briceburg
briceburg / gist:81d2c8d95a7cf4f61c0a
Created May 17, 2014 00:57
simple linux shell script to adjust backlight - useful for xmonad
#!/bin/bash
# backlight brightness controls. use freely
# and adjust sysfs directory if not on toshiba
# $author Brice Burgess @iceburg
sysfs="/sys/class/backlight/toshiba"
max=`cat ${sysfs}/max_brightness`
level=`cat ${sysfs}/brightness`
@briceburg
briceburg / MultiFormMultiStep.php
Last active August 29, 2015 14:01
MultiFormMultiStep > A SilverStripe MultiForm Step allowing for a dynamic number of questions/answers. Useful for CMS generated surveys &c.
<?php
/**
* MultiFormMultiStep allows answers to be collected for a dynamic number of
* questions as a single MultiFormStep. This is useful if you have an unknown
* amount of questions (e.g. dynamically generated by a CMS based survey maker).
*
* Define the next and previous steps as usual -- but to get to the next step,
* isLastQuestion must return true. Similarly, to get to the previous step
* isLastQuestion must return true.
@briceburg
briceburg / lxc-centos
Created August 10, 2014 02:10 — forked from hagix9/lxc-centos
CentOS 6.5 LXC Template for Debian Wheezy / Ubuntu ( release 6.5-11.1 / final )
#!/bin/bash
#
# template script for generating CentOS container for LXC
#
#
# lxc: linux Container library
# Authors:
@briceburg
briceburg / python pageloadtimes
Last active August 29, 2015 14:05
reporting pageload times to librato with python ; useful for monitoring responsiveness and triggering error situations via thresholds
#!/apps/pageloadtimes/venv/bin/python
#
# librato-pageloadtimes.py
# / Brice Burgess @iceburg_net
#
# Reports the load time (in milliseconds) of URLs from url_list
# as a metric named "pageloadtimes.<hostname>" to librato.
#
# For easy instrumentation, the URL is reported as the metric's "source"
@briceburg
briceburg / _etc_init.d_nullmailer
Created August 15, 2014 07:11
CentOS / RedHat LSB init script for nullmailer MTA
#!/bin/bash
#
# nullmailer MTA
#
# chkconfig: - 85 15
# description: nullmailer centos init @iceburg_net
### BEGIN INIT INFO
# Provides: smtpdaemon
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
@briceburg
briceburg / SodiumFreePasswordEncryptor.php
Created November 14, 2014 23:36
SodiumFreePasswordEncryptor ( Salt-less MD5, SHA, &c ) - The necessary evil for seamlessly migrating accounts/passwords into SilverStripe 3.1 + projects
<?php
/**
* Sodium Free Password Encryptor -- for importing legacy passwords
* into SilverSripe 3.1+ projects
*
* 1. Register via mysite/_config/encryptors.yml, e.g.
**
---
@briceburg
briceburg / gist:9a11858be7bc34fe128d
Created November 26, 2014 07:31
overriding GridFieldAddNewMultiClass ItemRequestClass to set some default ManyMany values
<?php
class GridFieldConfig_FlexiForm extends GridFieldConfig {
public static function include_requirements() {
$moduleDir = self::get_module_dir();
Requirements::css($moduleDir.'/css/flexiforms.css');
}
public static function get_module_dir() {
@briceburg
briceburg / gist:15723ad114cfb8e25051
Last active October 25, 2019 16:02
silverstripe - add dataobject button to cms / modeladmin
class BillingAgreement extends DataObject
{
public function getCMSActions() {
$fields = parent::getCMSActions();
$button = new FormAction('doMarkProcessed', 'Mark Processed');
//$button->addExtraClass('ss-ui-action-constructive');
$fields->push($button);