Skip to content

Instantly share code, notes, and snippets.

@emileswarts
emileswarts / logging_finale.md
Last active July 21, 2020 13:38
Logging finale

We've spent quite a bit of time finessing the current system. Given it's been running for a while, and we have alarms, it's quite easy to tell whether we've broken something

Final upates

This means:

  1. Tightening up security
  2. Ensuring a good developer experience for the next team, also ensuring READMES are up to date
  3. Collaborating with OST to make sure the data that is coming through is in the correct format.
@emileswarts
emileswarts / tf-state-provision.sh
Created June 12, 2020 12:17
Provision S3 buckets for state management with Terraform
#!/bin/bash
set -x
aws sts get-caller-identity --region eu-west-2
echo $AWS_PROFILE
aws s3 ls
@emileswarts
emileswarts / retro.md
Last active February 15, 2018 13:53
Retro

Introduction (5 min)

  • As we come to the end of this project, it is good to do a handover and retrospective.
  • Today is our last day on this project.
  • Pretty sad about that. It's been great to work with GDS and you two specifically so thank you.

What we want to get out of this meeting

Not just about handing over the project but to give you an opportunity to share your experience of working with us. We're always looking to learn and improve, so any feedback is useful.

Agenda (2 min)

@emileswarts
emileswarts / fast_tests
Created September 11, 2016 13:07
Fast tests clojure
In the repl
(def gogo [] (use 'made-merits.test.service.boyscouting-detector :reload) (use 'made-merits.service.github.boyscouting.detector :reload) (run-tests))
In Vim
nnoremap <leader>x :silent !tmux send-keys -t 2 '(gogo)' C-m<cr>
{:index=>"development",
:type=>"collection_item",
:body=>
{"id"=>1,
"title"=>"Grapes on the Vine",
"uid"=>"VAA0021",
"image_file_name"=>"VAA0021_websource.jpg",
"description"=>"",
"short_description"=>
"Water colour drawing, by George Dionysus Ehret, England, dated 1747.",
@emileswarts
emileswarts / nothing.sh
Created August 3, 2016 16:59
nothing.sh
#!/bin/bash
declare -a host_list
declare -a user_list
declare -a passwd_list
declare passwd_res
declare host_list_num=0
declare user_list_num=0
declare passwd_list_num=0
declare sshcrack_logfile="sshcrack.log"
Started POST "/en-us/referrals/signup/" for 10.0.2.2 at 2016-02-15 19:33:23 +0000
Processing by ReferrerController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"68MglbQSox6p4T8YkaAQcCg3fu5uaigrcZmlBMWrC5o=", "referral_program_referrer"=>{"name"=>"en", "last_name"=>"en", "email"=>"enseiseisei@iesisesie.com", "address_attributes"=>{"address_1"=>"en", "address_2"=>"en", "postal_code"=>"en", "city"=>"en", "spree_country_id"=>"20"}, "t_shirt_size"=>"W XS", "signup_language"=>"en"}, "button"=>"", "language"=>"en", "country"=>"us"}
Spree::Preference Load (0.6ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'spree/frontend_configuration/locale' ORDER BY `spree_preferences`.`id` ASC LIMIT 1
(0.3ms) BEGIN
Spree::Preference Exists (0.5ms) SELECT 1 AS one FROM `spree_preferences` WHERE (`spree_preferences`.`key` = BINARY 'spree/frontend_configuration/locale' AND `spree_preferences`.`id` != 21) LIMIT 1
SQL (0.4ms) UPDATE `spree_preferences` S
MYSQL
When(/^I visit comment page (\d+)$/) do |page|
CacheSweeper.stub(expire_cache: nil)
CommentSweeper.any_instance.stub(clear_cache: nil)
10.times { News::Item.first.comments << FactoryGirl.build(:comment, published: true)
p News::Item.first.comments.where('published = ?', true).page(page).per(Comment.config.per_page).map(&:id)
en
=> [16, 15, 14]
let barposition = "bottom"
set noautofocus "The opposite of autofocus; this setting stops sites from focusing on an input box when they load
set typelinkhints
let locale = "uk"
let hintcharacters = "arstenio"
let completionengines = ["google", "bing"]
let searchalias g = "google" "Create a shortcut for search engines. For example, typing ':tabnew g example' would act the same way as ':tabnew google example'
let mapleader = ","
unmap e
unmap d