Skip to content

Instantly share code, notes, and snippets.

View simonbaird's full-sized avatar
💭
🤔

Simon Baird simonbaird

💭
🤔
View GitHub Profile

HACBS Enterprise Contract Policies

About

The HACBS Enterprise Contract is a Tekton task that can be used to verify the provenence of a container image built in HACBS and validate it against a set of policies.

@simonbaird
simonbaird / README.md
Last active April 2, 2021 18:08
Bookmarklet for unchecking tasks in a Confluence document

If you want to uncheck all the checkboxes in a Confluence page with many tasks in it then try this bookmarklet.

Go to Bookmarklet Crunchinator (or similar) to generate a bookmarklet using the contents of src.js below.

See also this feature request.

Update: actually it's not working for me in a bookmarklet, but works fine from Scratchpad in Firefox.

@simonbaird
simonbaird / tau.patch
Created June 16, 2011 15:51
Patch ruby to define tau
diff --git a/ext/bigdecimal/lib/bigdecimal/math.rb b/ext/bigdecimal/lib/bigdecimal/math.rb
index c17841f..c672cbf 100644
--- a/ext/bigdecimal/lib/bigdecimal/math.rb
+++ b/ext/bigdecimal/lib/bigdecimal/math.rb
@@ -9,6 +9,7 @@ require 'bigdecimal'
# atan(x, prec) Note: |x|<1, x=0.9999 may not converge.
# exp (x, prec)
# log (x, prec)
+# TAU (prec)
# PI (prec)
@simonbaird
simonbaird / dbdump.sh
Created March 17, 2011 00:26
Some bash functions to dump and load a mysql database
# Dump a mysql database to a gzipped sql file
dbdump() {
# (adjust defaults as required)
GZ_FILE=$1; [ ! -n "$GZ_FILE" ] && GZ_FILE="$HOME/.dbdump.gz"
DB_NAME=$2; [ ! -n "$DB_NAME" ] && DB_NAME='fms'
echo -n "Dumping database $DB_NAME to $GZ_FILE..."
# Add --extended-insert=FALSE to mysql command for more readable but MUCH slower sql
mysqldump -u root $DB_NAME | gzip - > "$GZ_FILE"
echo ' Done'
}
@simonbaird
simonbaird / gist:663503
Created November 5, 2010 01:16
Little bash script to nuke a branch in git
#
# https://gist.github.com/663503
#
# Use this to clean your repo by removing old branches.
# It will remove the branch on local and on origin.
#
# Usage:
# $ nuke_branch some_old_branch_you_dont_need
#
# Note we use -d not -D for teh safety.
@simonbaird
simonbaird / foo.rb
Last active December 16, 2015 00:59 — forked from anonymous/foo.rb
# For @echorand :)
require 'test/unit'
class Float
class NoYouCantBecauseMaths < RuntimeError; end
def even?
raise NoYouCantBecauseMaths unless whole_number?
to_i.even?
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']"
@simonbaird
simonbaird / .gitconfig
Created October 31, 2012 02:22
Nice brief git logs
[core]
# -E means don't page if less one screen
# -F means quit when EOF reached
# -r fixes the %C(yellow)%+d colouring somehow
pager = less -E -F -r
[alias]
ll = log --pretty=nice -n 30 # about one screen worth
lll = log --pretty=nice # goes back forever
@simonbaird
simonbaird / block_render_helper.rb
Created August 8, 2012 08:02
block_render rails helper
#
# A trick so you can have partials that take blocks.
# Uses render :layout.
#
# Example:
# <%= block_render 'some_partial_with_a_yield', :foo => 123 do %>
# Any erb here...
# <% end %>
#
def block_render(partial_name, locals={})
@simonbaird
simonbaird / styles.css
Created August 8, 2012 07:00
Make pinned tabs in Firefox a bit wider
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
.tabbrowser-tab[pinned] {
width: 72px;
}