Basic Redux setup

Redux, boy. I don’t know of anything that has a steeper learning curve. Root reducers? Store factories? mapStateToProps? Higher-order functions? Connected components? Action creators? Thunks? Dispatch? For someone who’s feeling smug about getting a hang of basic React, it is a lot of moving parts to get a grip on. Anyways, here’s a basic cheat-sheet […]

Adding a ‘close’ button

function goBack() { if (document.referrer == ‘https://alesh.com/’) { window.history.back(); } else { window.location.href = ‘https://alesh.com/’ } } I wanted to create a button with a “close” icon for my website that would make the feeling of going back to the home page feel light and easy. The homepage is fairly long, so I also wanted […]

Deploying a Laravel application to DreamHost shared hosting, 2018 edition

Unfortunately, this sort of information changes regularly. Google “dreamhost laravel” and you’ll get some articles from a few years ago which, while helpful, were not sufficient for me. A few examples: Setting up a Laravel application on a DreamHost shared hosting account Deploy Laravel 5 application on shared hosting The simple guide to deploy Laravel […]

Slideshow with updating URI location

var fadeDuration = 2000; $(function() { var $slides = $(‘#slideshow > div’); $slides.hide(); var currentSlide = Number(location.hash.slice(1)); $slides.eq(currentSlide).fadeIn(fadeDuration); $slides.click(function() { $slides.eq(currentSlide).fadeOut(fadeDuration); currentSlide ++; if (currentSlide == $slides.length) currentSlide = 0; $slides.eq(currentSlide).fadeIn(fadeDuration); location = “#” + currentSlide; }); }); This code is pretty rough, but it does two notable things. First, a slideshow that advances on […]