Smooth Scroll with jQuery

Smooth Scroll with jQuery

Every now and then I get some really cool feature request, nothing too big – just something simple yet effective. Anchor links aren’t talked about much these days but they’re so useful in situations where you run into a really long website with a lot of content (or anything), you have to keep scrolling down just to get to the footer. Worse yet, what if the contact form is down at the footer – that’s a lot of wasted time, space and potential customers lost. Not a good thing.

The solution and probably the most simple and effective way is to add an anchor link. This can easily be done with plain HTML.

Continue reading “Smooth Scroll with jQuery”

Javascript Debugger Statement

Javascript Debugger Statement

I was working on a behemoth, yeah look it up – the word means monstrous and enormous in size. This project was more on the marketing side, so there were a lot of platforms mixing in with this project, one of them being Hubspot – a marketing software for managing leads. I’ve never worked with HubSpot before, but I was totally game.

In troubleshooting the underlying issue(s), I like to categorize projects like hurricanes – cat1, cat2, cat3, cat4, cat5. This one was a cat4. Partly because it’s history was so vague, the type of project where you’re shooting darts in the dark. But the other half was much simpler – I just had to get familiarized with Hubspot, but this is an entirely different topic. I went off tangent here for a bit. Moving on.

Continue reading “Javascript Debugger Statement”

Youtube Auto Loop a Video

Looping a Youtube Video

I was working on adding a few features to a pet project – one of them was allowing users to add a youtube video to their profile page. In order to this though, we need to get familiarized with youtube and a few parameters we already know.

A commonly known parameter is autoplay, if we set this to “1” – the youtube video will play automatically on an initial page load.

The general structure is illustrated below, get familiar if you aren’t already – this is a pretty cool feature.

Continue reading “Youtube Auto Loop a Video”

Javascript Fundamentals

Javascript Fundamentals

Whoa that title, yeah it made me cringe a little don’t ask me why. Perhaps it’s because I’ve seen it over countless times but I couldn’t think of a better title. I was gonna go with “Vanilla Javascript” but we all know that deserves it’s own space.

Javascript fundamentals is like going back in time, sort of like when the earth was formed. Were not going to get into the details of lexical environments or function scope or objects, well maybe a little on objects. Were going to just simply define a few javascript constructs.

Continue reading “Javascript Fundamentals”

PHP’s is_numeric function

PHP is_numeric function

I’ve been wanting to write about PHP’s is_numeric() built-in function partly because I forgot all about it one day while validating one of my forms.

I get super anal about form validation because if it’s anything that’ll make or break your web application it’s security. Something dirty gets through your form it’s game over – or just bad data, bad quality. This means bad user experience – see how this kind of thing can trickle down through your application you worked so hard on?

Continue reading “PHP’s is_numeric function”

The PHP 7 Story

The PHP 7 Story - Rasmus Lerdorf

I’ve been craving me some PHP lately, not PHP code per se – I code in PHP on the daily. PHP was my first programming language – I fell for PHP the moment I saw it’s power, its force.

So this post is titled “The PHP 7 Story”, it sounded so cool. I’d like to give ALL the credit to Zeev Suraski for inspiring me to write this post. Yeah I didn’t know who this dude was either. I mean you probably know who “Rasmus Lerdorf” is if you’ve been programming in PHP a long while. So if Rasmus is the god of PHP, Zeev would be the demi god of PHP. Zeev gave a speech in Barcelona back in 2015 – yeah I’m so late to the conference attending game. My friends tell me I should get out and travel, makes me feel like a sheltered programmer but being a programmer is unlike any other profession or craft. Programming is within itself a traveling experience – yeah even time travel, anything is possible in the virtual world. Whoa I just felt like Neo from the matrix.

Continue reading “The PHP 7 Story”

React Fundamentals – ReactJS

React Fundamentals – ReactJS

I didn’t know what to title this post – I’ve got tons of thoughts about ReactJS. At the time of this post, ReactJS has taken single page apps to another level, well I shouldn’t say another level – it just sounded cool. Yeah there are others out there – I actually like Vue.js, it’s a much lighter version compared to react. And Angular(what version is out now) – I make mention of this framework with a little snark because I’ve wrestled with it many times in the past. At the moment I’m not really a big fan of Angular, sorry Angular but there’s just way too much stuff going on with you. Maybe things will change.

I wanted to make another post dedicated to just my thoughts on ReactJS but then I’ll be overthinking it and then I’ll end up going in circles. So let’s just get on with it.

Continue reading “React Fundamentals – ReactJS”

Using jQuery to automatically download a PDF file

Window Location Href in Javascript

I’ve been working through one of those client requests that isn’t use too often. They wanted a PDF be automatically downloaded after submitting their email (the only field on the form).

I started thinking about different scenarios, particularly this one:

If a visitor successfully completes the form and hits submit, should the PDF open on a new window tab or should it be automatically be downloaded?

Continue reading “Using jQuery to automatically download a PDF file”