Joseph Weber
Name
 
Occupation
 
Submit

Today I Learned: PHP getallheaders() method and NGINX

PHP has a useful getallheaders() method that returns a request’s HTTP headers as an array. I was using this for my organization’s CMS to check the origin of a request so I could enable CORS for whitelisted origins. It worked fine on my local machine, but when I deployed it to production it returned a 500 error. The only difference between my local installation of the CMS and the production environment is that I’m running Apache on my machine, but the server is running NGINX.

Read more

A smoothie recipe in code

I made a delicious smoothie this morning and thought I would share the recipe with you:

Read more

Internet Explorer bug involving em units in before and after pseudo elements

I ran into a frustrating bug in Internet Explorer the other week, and I wanted to document it here, both for my own recollection and just in case someone else stumbles upon this post and finds it helpful.

Read more

Today I Learned: Rendering View and Layout in Rails

It’s possible to specify both the view and the layout when calling the render method in a Rails controller. Most examples of using the render method (at least that I’ve seen) only show how to specify the view, defaulting to the layout defined for the whole controller or application:

Read more

Accessing clipboard data with Javascript

You can access clipboard data after user input, but of course, it doesn’t work the same way in every browser. Internet Explorer, I’m looking at you.

Read more

Vertically Center Aligning Content with CSS

One of the most frustrating limitations of less-than-modern browsers is their inability to easily vertically center align content. I’m not the first to write about this, and there are many different strategies out there already. I’ve tried several over the years, looking for an as-close-as-possible pure CSS solution that is cross-browser compatible (I’m one of the unlucky ones who still needs to support IE8). Flexbox has solved this issue for the latest modern browser versions, but cross-browser support is still too lacking for me to implement it in my work. I think I’ve arrived at a good solution that relies almost entirely on CSS and only requires minimal JS to handle IE8 and cases when the content’s height exceeds the height of its container.

Read more

Semi-sticky Navigation

I’ve been working on a proof-of-concept for a fixed navigation bar that is partially hidden/revealed in response to the scroll direction. I don’t know what the correct term is for this type of navigation interaction, so for now I’m calling it “semi-sticky”.

Read more