Skip to content

Instantly share code, notes, and snippets.

Chris Roos chrisroos

Block or report user

Report or block chrisroos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 2017-07-30-amazon-kindle-voyage-notes.md
  • I noticed for the first time this morning that the buttons on the left and right of the screen are to move forward through the book. I'd previously assumed they were for moving backward and forward through the book.

  • I plugged the device into my laptop and copied a PDF (printed from Pocket) to the documents folder. This showed up on the homescreen and I was able to read it.

  • I changed the email address for my device to something more friendly and emailed a PDF (printed from Pocket) to it. It showed up on the homescreen of my Kindle in no time. And shows up in "My Content" at Amazon.com.

View 2017-07-27-performance-testing-asset-manager-on-ec2.md
ubuntu@ip-172-30-0-184:~/asset-manager$ ab -n1000 "http://asset-manager.ec2.gov.uk/media/597a14f18456ae0dfd5ad8b8/1MB.dat"
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking asset-manager.ec2.gov.uk (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
View 2017-07-27-host-asset-manager-on-ec2.md
  • AMI: ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20170727 (ami-1e749f67)
  • t2.large instance
$ sudo apt-get update
$ sudo apt-get install -y git

$ sudo apt-get install -y gcc build-essential
$ sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev
@chrisroos
chrisroos / README.md
Last active Jul 27, 2017
2017-07-26 Asset Manager Performance Testing
View README.md

Creating files of n size

dd if=/dev/zero of=1MB.dat  bs=1m count=1

Upload file to Asset Manager

@chrisroos
chrisroos / liquid-templates-and-date-formats.rb
Last active May 2, 2017
Playing with date formatting in liquid templates - Useful in Harmonia task titles
View liquid-templates-and-date-formats.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'liquid'
end
require 'date'
require 'liquid'
View 2017-02-10-moving-files-between-google-drive-accounts.md

"Moving" files between Google Drive accounts

The way to do it seems to be to share the files from the source account to the destination account, copy the files in the destination account and then remove the files from the source account.

Sharing the files with the destination account and then removing them from the source account results in them being removed from the destination account.

Sharing the files with the destination account, adding them to My Drive in the destination account and then removing them from the source account results in them being removed from the destination account.

View README.md

This demonstrates the difference in behaviour when using the public|protected|private_methods methods to check for the presence of a module method defined on Kernel or Object versus those defined in another Module.

View 2017-01-11-using-ifttt-and-google-calendar-and-recurring-tasks.md

Using IFTTT to handle future and recurring tasks

  • Store the tasks in our "GFR Tasks" Google calendar.

    • Relatively fine grained control over dates of tasks (e.g. second Wednesday of each month)
  • IFTTT applet turns these events into cards in Trello

    • Our applets
    • "If any event starts on GFR Tasks, then create a card in - Go Free Range board"
    • Fires 15 minutes before the start date of a task, i.e. 23:45 for all day tasks
View 2017-01-11-reviewing-github-pull-requests.md

Reviewing Pull Requests

This was the habit I got into when working on Smart Answers. I'm aware that there have been some changes to the PR process since I last used it so it's possible I'd do things differently next time.

  1. Read the description and comments on the Pull Request

For example, my [PR 269 in the Mocha project][mocha-pr-269].

  1. Create a worktree for the remote branch
View 2017-01-11-github-commit-ordering.md

GitHub commit ordering

GitHub's ordering of commits is explained in their ["Why are my commits in the wrong order" help page][github-commit-ordering].

  1. Create new repo on GitHub

  2. Clone locally to /tmp/

    $ cd /tmp
You can’t perform that action at this time.