The UniFi AP-AC Lite

Mon 04, May 2020

I love the UniFi AP-AC Lites. They're awesome. Another one came in the post today and I was really hyped to set it up. They have an amazing reach and good speeds. Setting new ones up is as easy as plugging them into the network, opening up the UniFi network controller and integrating the new AP.

About 1 month ago I started with the UniFi system and it's really awesome - everything in one place. They not just have a really cool web dashboard, but a beautiful iOS app as well. Setting things up is really easy and extremely quick.

Edit: one thing that's really worth mentioning too: their packaging is nearly only made from paper! Really cool!

Add CSS to a page using HTTP headers

Tue 28, Apr 2020

Hey y'all,

I just read about the Link header at Impressive Webs. It works just like the <link> HTML tag. That means that you can use it to add stylesheets to a website! Below is a PHP-based demo:

The page:

<?php
header('Link: <styles.css>; rel=stylesheet');
echo '<p>Some text here. This will get displayed using a sans-serif font if your browser supports the Link header. If not, your browser\'s default font will be used.</p>';

The stylesheet (named styles.css):

html,
body {
    font-family: sans-serif
}

The header will look like this:

Link: <styles.css>; rel=stylesheet

You can add multiple stylesheets by adding multiple Link headers, btw.

Browser support

Even though this is a standardized feature that has been around since HTML4, it seems to work in Firefox only. It is not deprecated, though. This is what the HTML4 spec says about it:

This section only applies to user agents conforming to versions of HTTP that define a Link header field. Note that HTTP 1.1 as defined by [RFC2616] does not include a Link header field (refer to section 19.6.3).

Why bother if it's only supported in Firefox?

I think it's just something really cool to look at. If you use it in a project, I'd highly recommend you to use <link> in addition, because otherwise most users probably won't see your stylesheets.

If you want to find out more about it, I'd highly recommend you to read this article at Impressive Webs and look at the Link header's MDN page.

Internet Outage

Tue 28, Apr 2020

Had an internet outage yesterday. Seems like I wasn't the only one having trouble. The problems are resolved for me now.

Rewriting this site using Sierra

Mon 20, Apr 2020

Hi!

Over the last few days I've been re-writing this homepage yet another time. This time using my new framework.

A few URLs might have changed and some stuff has been removed, keep that in mind if you've linked to this site in the past.

Silence

Sun 12, Apr 2020

I just walked around the city's fields. My city is sourrounded by highways, you can always hear their constant noise. But today, everything was silent. You could only hear some birds chirping. Incredible.

The GitHub iOS app

Wed 18, Mar 2020

The GitHub iOS app is finally available! It's pretty cool imo (and has multiple icons you can choose from!)

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6

New in PHP: str_contains

Mon 16, Mar 2020

RFC str_contains has been merged into PHP:

str_contains checks if a string is contained in another string and returns a boolean value (true/false) whether or not the string was found.

It's basically just a shorter way of writing strpos($haystack, $needle) !== false. It will be available in PHP 8.

Example (taken from the RFC page):

str_contains('abc', 'a'); // true
str_contains('abc', 'd'); // false

// $needle is an empty string
str_contains('abc', '');  // true
str_contains('', '');     // true

Sierra code snippets for VS Code and Sublime Text

Mon 16, Mar 2020

Hi!

I just created some code snippets for Sierra for use with VS Code and Sublime Text. You can get them from GitHub (sierra-project/ide-snippets).

There are only two snippets for now: ctrl and mdl. You already guessed it: the first one sets a new controller up and the second one sets a new model up. If you've got any improvements or more Sierra-related code snippets, drop me a PR.

Time Machine backups on regular SMB drive

Fri 13, Mar 2020

I just set up my Mac to save Time Machine backups to a regular SMB share. Doing this is actually quite easy:

Step 1: Create a .sparsebundle

Open Disk Utility and choose File => New Image => Blank Image.

Give the image a name and size (check the Time Machine settings first to see how large your backups will be).

IMPORTANT:

Now click Create.

Step 2: Copy the .sparsebundle to your server

Unmount the .sparsebundle by clicking the eject icon next to the image's name in the Finder sidebar. Now copy the .sparsebundle onto your server. You can now delete the original version from your Mac, just make sure that the copy is on your server.

Step 3: Configure Time Machine

Open up a new Terminal window and type

sudo tmutil setdestination "/Volumes/NameOfYourImage"

(replace NameOfYourImage with the name of your .sparsebundle image)


Congratulations, you're done! Now you can start a new backup in the Time Machine settings.

Git: Deleting the last pushed commit

Wed 11, Mar 2020

This is something I really gotta remember:

git push origin +abcd1234^:master

The above example deletes the commit abcd1234 (the newest one) on the branch master and pushes it to origin.

You are on page 2 right now.


Back to top