Skip to content

Instantly share code, notes, and snippets.

@hughevans
hughevans / main.yml
Created May 21, 2021 04:05
Simple Github action for npm test
name: CDK snapshot tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
@hughevans
hughevans / build.sh
Created August 12, 2019 05:56
exiftool Lambda layer Node 8.10
#!/bin/sh
export EXIFTOOL_VERSION=11.61
export PERL_VERSION="5-30"
rm -rf layer
curl -sS https://shogo82148-lambda-perl-runtime-ap-southeast-2.s3.amazonaws.com/perl-${PERL_VERSION}-runtime.zip > perl.zip
mkdir layer
cd layer
unzip ../perl.zip
@hughevans
hughevans / keybase.md
Created November 29, 2017 03:42
keybase.md

Keybase proof

I hereby claim:

  • I am hughevans on github.
  • I am hughevans (https://keybase.io/hughevans) on keybase.
  • I have a public key whose fingerprint is 620D A6F2 1939 EC9A 4336 9744 FA28 4E7A 7F8F F301

To claim this, I am signing this object:

@hughevans
hughevans / Trademarks
Last active September 7, 2016 22:20
Apple’s TOP SECRET product naming generator
> 10.times { puts namify }
Apple MacBook S
Magic MacBook Air
Apple Phone
Air Phone
Air Pad Pro
Car Pod Pro
Car Mac
Phone Air
Watch SE
group :red_green_refactor, halt_on_fail: true do
guard :rspec, cmd: './bin/rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
@hughevans
hughevans / application.rb
Created October 27, 2014 00:12
Invalidate CloudFront cache of S3 assets in Comfortable Mexican Sofa after update or destroy using the Fog gem
module YourApp
class Application < Rails::Application
config.after_initialize do
Comfy::Cms::File.send(:include, ComfyCloudfront)
end
end
end
require 'comfy_cloudfront'
@hughevans
hughevans / cellar.md
Last active August 29, 2015 14:07
Keeping track of the incomings and outgoings of my wine cellar.

Red

22 × Anvers Adelaide Hills Brabo Cabernet Sauvignon 2013
12 × Wynns Coonawarra The Siding Cabernet Sauvignon 2012
12 × Wynns Coonawarra Shiraz 2012
12 × Gemtree McLaren Vale Uncut Shiraz 2012
11 × Metala Langhorne Creek White Label Shiraz Cabernet 2010
 8 × Sandalford Margaret River Parmelia Cabernet Merlot 2010
 5 × Leconfield Coonawarra Cabernet Sauvignon 2012
@hughevans
hughevans / to_sentence.js.coffee
Created February 3, 2014 02:45
Javascript Array toSentence()
Array.prototype.toSentence = (oxfordComma) ->
firstWord = if typeof this[0] is 'string' then this[0].charAt(0).toUpperCase() + this[0].slice(1) else this[0]
conjunction = if oxfordComma then ', and' else ' and'
switch @length
when 0 then ''
when 1 then "#{firstWord}."
when 2 then "#{firstWord} and #{this[1]}."
else "#{firstWord}, #{@slice(1, -1).join(', ')}#{conjunction} #{this[@length - 1]}."
// No FOUT
html.js {
&.wf-loading {
.all, .your, .text, #selectors {
opacity: 0;
}
&.no-opacity {
.all, .your, .text, #selectors {
visibility: hidden;
@hughevans
hughevans / Procfile
Last active December 31, 2015 02:39
web: bundle exec puma -p $PORT -C config/puma.rb