Skip to content

Instantly share code, notes, and snippets.

View simonbaird's full-sized avatar
💭
🤔

Simon Baird simonbaird

💭
🤔
View GitHub Profile
@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?
@simonbaird
simonbaird / with_stubbed_const.rb
Created March 13, 2015 01:26
Stubbing a constant in ruby
module WithStubbedConst
def with_stubbed_const(consts, scope=self.class)
stash = {}
consts.each_pair do |key, val|
stash[key] = scope.send(:remove_const, key)
scope.send(:const_set, key, val)
end
begin
yield
@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.

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.