brew install pcre2
find . -type f | xargs pcregrep -M 'pattern'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var browser = new Browser(); | |
browser.visit('/hello', function() { | |
// do some checks | |
// I'm not sure if browser.resources is an official part of the Zombie API (I found it by searching the src) | |
// so be wary in case it changes | |
browser.resources.post( | |
'/authenticate?email=hello@example.com&password=' + auth_token, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# This provides `create_enum` and `drop_enum` methods for migrations, which creates | |
# a Postgres ENUM type with the provided values. | |
# | |
# It'll also dump these into the schema.rb to be loaded into another DB (e.g. rake db:test:load) | |
# | |
# In order to reference the new enums as actual types, ActiveRecord needs to know about them, so | |
# make sure they are all represented in the `types` array below | |
# | |
# Then you can reference them in your migrations, e.g. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This will force ActiveRecord to create proper `interval` column types in PostgreSQL | |
# | |
# def change | |
# add_column :leases, :period, :interval | |
# end | |
# | |
# This applies to a generated `schema.rb` file too. | |
# | |
# No special OID type is applied to an `interval` type. Rails will treat it as a string, although |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This lambda function can be linked with CloudWatch events to send Task state changes to | |
# a CloudWatch Logs stream | |
# | |
# This is highly recommended as, in my experience, the API does *NOT* return all state change | |
# events; this is the only way to reliably see them all | |
import os | |
import time | |
import json | |
import boto3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this will provision a Ubuntu box with a basic lamp stack including a db/user for Prestashop | |
# it downloads Prestashop 1.5 into /tmp but doesn't install it, although you could quite easily | |
# extend this playbook to do that as you can run the prestashop installer via the shell | |
--- | |
- hosts: all | |
sudo: True | |
tasks: | |
- name: apt-get update | |
command: apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The database recipe should be included by any server running a DB. It creates | |
# a /data directory and, if on EC2, will mount an EBS volume here | |
directory '/data' do | |
mode '0755' | |
end | |
if node[:app][:ec2] || node[:cloud][:provider] == 'ec2' | |
aws = data_bag_item('aws', 'main') | |
include_recipe 'aws' |
clarkdave.net/files/osx-british.zip
Place in /Library/Keyboard Layouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
# Use this script template to bootstrap a Chef Server (version 12) | |
# | |
# - bootstraps the Chef server using chef-solo and the official chef-server cookbook | |
# (https://github.com/chef-cookbooks/chef-server) | |
# - uses Lego (acme client) to generate and renew an SSL certificate for the server | |
# - installs the manage (web ui), push jobs and reporting addons (free for < 25 nodes) | |
# - configures a few sane defaults (no sign ups from web ui) | |
# |
I hereby claim:
- I am clarkdave on github.
- I am clarkdave (https://keybase.io/clarkdave) on keybase.
- I have a public key ASAAW7KQ7BqcEQjDD--DhGxAF_Ufz_IT71BmARZuxJotRwo
To claim this, I am signing this object: