Tracing or Preventing HTTP Redirects in Golang

In this post we’re going to have a look at how to have a close look at HTTP requests processed by Go and how to prevent automatic redirection through 301, 302 or similar redirects. This is useful both for investigating tracking links from twitter, buffer, bit.ly or email marketing, or to make sure your tools to generate them actually work πŸ˜‰ For a demo, check out the Redirect Checker Tool

Continue reading “Tracing or Preventing HTTP Redirects in Golang”

Best (light) Atom Editor Themes

This post will present the best light or bright atom editor themes I’ve found so far. Usually I pick one of the dark atom themes, but the light ones are usually a little more subtle and often relaxing to look at.

For the screenshots I used the One Light UI theme, which I also use with the light / bright themes in my everyday coding adventures.

No matter if you prefer bright background themes or if you just need to turn up your screen brightness in order to get through winter without a depression, I’ve compiled a list of some themes you might enjoy!

Continue reading “Best (light) Atom Editor Themes”

[Solved] Laravel: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

Recently I set up a project with theΒ laravelΒ PHP framework and hit a little bump right away. AfterΒ cloning my project on my computer at home, I encountered an error message about the AES key length.

Luckily I wasn’t the only one with that issue and running the following and conveniently available artisan commands fixed it already:

php artisan key:generate
php artisan config:clear

Continue reading “[Solved] Laravel: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.”

[Solved] Upgrading Oh My Zsh: Cannot pull with rebase

I’m a big fan of oh my zsh, but recently I had a small problem upgrading it. The error message I got indicated that I had a changed file that couldn’t be overwritten automatically. My suspicion is that I installed some docker autocomplete plugin that I somehow didn’t install quite correctly.

Updating Oh My Zsh
error: Cannot pull with rebase: You have unstaged changes.
There was an error updating. Try again later?

Continue reading “[Solved] Upgrading Oh My Zsh: Cannot pull with rebase”

[Solved] gitbook TypeError: Cannot read property ‘file’ of undefined

Tonight I came across an issue in gitbook. First of all I want to say that it’s a wonderful piece of software and they’re trying super hard to build a great service out of gitbook.com to empower self-publishers, but this curiousΒ bug had me wondering quite a bit.

Continue reading “[Solved] gitbook TypeError: Cannot read property ‘file’ of undefined”

[Solved] Linux Mint 18 not waking up from Suspend / Hibernate after Lid close

My Linux Mint 18 today was refusing to wake up from Suspend/Hibernate after I had closed the lid. It’s a little odd, because I went for the cinnamon and all other niceness installation variant, an image that wouldn’t even fit on a 2GB USB flash drive.

The only thing I apparently had to do was to open the driver manager and install the graphics drivers, followed by an apt-get update && apt-get dist-upgrade

Continue reading “[Solved] Linux Mint 18 not waking up from Suspend / Hibernate after Lid close”

Node.js / GHOST theme development and deployment

Few weeks ago we decided to switch our static site to GHOST and write a theme for it. Now, GHOST isn’t an optimal choice for a photography portfolio and we’ll get into why that’s the case in a bit, but we both like blogging to, so we wanted to give it a shot.

Continue reading “Node.js / GHOST theme development and deployment”

Example: JSON Web Tokens with Vanilla JavaScript

In this post we’re going to learn how to use JSON web tokens on the frontend with vanilla JavaScript and no libraries necessary. What you learn will be easily applicable to frameworks such as Angular, Angular2, Vue.js or similar.

In the last post we had a look at how to create an express app with jwt authentication.

Why No Framework?

I wanted to write a post simply illustrating how everything works and how easily this can be achieved without any frameworks in place. It’s just another layer of abstraction you have to learn if you’re just trying to build some sort of login for your web app.

Continue reading “Example: JSON Web Tokens with Vanilla JavaScript”

Express, Passport and JSON Web Token (jwt) Authentication for Beginners

This post is going to be about creating an authentication with JSON Web Tokens for your project, presumably an API that’s going to be used by Angular, Vue.js or similar frontend frameworks. We’re going to send the jwt with every request, meaning that we don’t rely on sessions, but simply put the token on every request we make to the API. This way you don’t have to worry about cookies, but you can save it in localStorage or other places on the frontend.

In essence this tutorial will go through:

  • creating a /login route to acquire a token
  • creating a /secret route, that only is available to logged in users with a JSON web token

If you’re curious about the final result and don’t want the step by step guide, check out the final jwt express gist.

Continue reading “Express, Passport and JSON Web Token (jwt) Authentication for Beginners”

Angular 2 Tips for Beginners

Angular 2 is out and if you haven’t, you should definitely check out angular.io, because the most valuable beginner material is in their Getting Started guide and the following Tour of Heroes.

Angular projects require quite a bit of setup with Angular 2, unlike most of Angular 1, which is a little inconvenient if you just quickly want to try out a couple of things and test the framework to see if it fits your needs, luckily there is a angular-cli that creates a boilerplate project for you whenever you feel like it.

Angular CLI

angular-cli-ng-new

Getting started with a fresh Angular project is pretty easy using angular-cli. Basically it takes care of initialising an Angular project including Typescript, webpack bundling and development server support.

npm -g install angular-cli
ng new awesome-project
cd awesome-project
npm i
ng serve

which leaves you with a project that will show you a simple view and has the files that are common for most Angular projects, like the app.components and app.modules files.

(master) % tree src
src
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ app.component.css
β”‚   β”œβ”€β”€ app.component.html
β”‚   β”œβ”€β”€ app.component.spec.ts
β”‚   β”œβ”€β”€ app.component.ts
β”‚   β”œβ”€β”€ app.module.ts
β”‚   β”œβ”€β”€ index.ts
β”‚   └── shared
β”‚       └── index.ts
β”œβ”€β”€ assets
β”œβ”€β”€ environments
β”‚   β”œβ”€β”€ environment.prod.ts
β”‚   └── environment.ts
β”œβ”€β”€ favicon.ico
β”œβ”€β”€ index.html
β”œβ”€β”€ main.ts
β”œβ”€β”€ polyfills.ts
β”œβ”€β”€ styles.css
β”œβ”€β”€ test.ts
β”œβ”€β”€ tsconfig.json
└── typings.d.ts

4 directories, 17 files

I must say, angular-cli takes a lot of the setup process away, the only problem is that it’s a little less explicit than having your own starter set and that the webpack configuration isn’t directly exposed.

Angular2 Beginner Video Courses

egghead-io-angular2

As usual, egghead.io courses are a great resource for learning JavaScript frameworks, Angular 2 is no exception and I can only recommend coding along on the basic track, also the first course makes use of angular-cli.

Summary

So far Angular2 has not always been easy to pick up, mostly due to breaking implementation changes throughout the different RCs, so not a lot of material except for the official documentation is up to date. Also, if you haven’t used Typescript before I recommend having a quick stab at a Typescript tutorial first to know what’s Typescript and what’s Angular magic πŸ˜‰