recursive file upload to s3 in terraform

I’ve been working a lot with HashiCorp’s terraform recently. From learning how to set up a highly available container based infrastructure using AWS ECS , to setting up a CloudFront distribution for a static site hosted on S3 . One problem I have had to solve a number of times, is uploading the contents of a directory recursively to an S3 bucket. With the help of a post from Andy Dote’s blog, I was able to get some files uploaded.

2 min read
Read more →

limit http requests with nginx

There are several ways that you can throttle the rate at which requests to your web application are processed. Rate limiting within your authentication mechanism is undoubtedly useful. However, the chances are that this requires several calls to database and cache. Database queries could become a costly operation when your application is running under load. To provide an extra layer of filtering, Nginx is capable of limiting request rates using the ngx_http_limit_req_module module.

3 min read
Read more →

laravel testing: database reset with seeding

Testing a Laravel application has a low barrier to entry compared to other PHP frameworks . What happens when you want to nuke the database between tests? I thought I’d share a solution here. feature testing One of the great features Laravel provides is the ability to refresh your database after each test. This has been really useful, but I needed to test verbs like DELETE and a simple php artisan migrate:fresh isn’t all that useful when you have seeds that add information to your database that your tests rely on.

2 min read
Read more →

warning users about insecure passwords

laravel pwned passwords validator This small guide expects you to have my pwned passwords validator for laravel 5.6. It’s painless to install and set up: $ composer require acodeninja/laravel-pwned-passwords-validator Once installed, Laravel’s package discovery will take care of loading the package for use in your application. Read more about using the validator . checking passwords and warning users on login To check if a password is secure each time a user logs in you can use the validator.

2 min read
Read more →

laravel pwned passwords validator

a bit about pwned passwords So, a while ago the pwned passwords database was made available to the public. It was a great idea, a collection of all the discrete passwords that had been included in all the data breaches from ’;–have i been pwned? . Annoyingly to check this database with version 1 of the api you could only specify a username to see if that was included in a breach.

2 min read
Read more →

laravel mix - lazy loading Vue components

why? Lazy loading components gives a great performance improvement. Larger components can take ages to load and result in an unusable page for a few seconds while the massive app.js file is loaded. how? You can follow these steps on the tutorial repo .

  1. babel plugins You will need to add both the babel-plugin-dynamic-import-webpack and babel-plugin-syntax-dynamic-import packages to your package.json $ npm install –save-dev \ babel-plugin-dynamic-import-webpack \ babel-plugin-syntax-dynamic-import tutorial commit 2.

2 min read
Read more →

dot files and the search for the perfect bash setup

Discussion about what makes a good bash prompt. Including examples.

4 min read
Read more →

a game - pugilica

Coming up with a great game idea was a lot harder than I initially thought, but then why did I think it would be easy anyway? Enter Pugilica, a game I thought up while toying with some dice and card mechanics. The basic mechanic for the game would be players taking turns to roll the dice, the roll deciding how many cards they could play that turn to effect other players.

3 min read
Read more →

a few thoughts on ad-blockers

Although content creators should have the opportunity to generate income from their work, this should not be at the expense of the end user. Online advertising networks have a responsibility to ensure that the content they are delivering does not contain malware. Advertisers need to ensure that their content makes efficient use of system resources. Adverts should complement the content on a page, rather than being specific to the end user.

1 min read
Read more →

html5 document ready

DOMContentLoaded, document ready or not? jQuery: overhead. document.addEventListener("DOMContentLoaded", function(event) { console.log('document load time: ' + event.timeStamp); });

1 min read
Read more →