Skip to content

Instantly share code, notes, and snippets.

Jake Bellacera jakebellacera

Block or report user

Report or block jakebellacera

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jakebellacera / hubspot-adwords-gclid-tracking.js
Last active Nov 12, 2019
Simple HubSpot gclid tracking code integration
View hubspot-adwords-gclid-tracking.js
// The script below will ensure that gclid parameters are associated with
// contacts in HubSpot.
// A few things are required before this script will work:
// * You will need to have the HubSpot tracking code installed on the page. A
// few modifications will be required if you don't have the tracking code
// installed. Additionally, you will lose out on the built-in cross-domain
// features that the hubspot tracking code uses to store cookies.
// * You will need to have this script installed on every page.
jakebellacera /
Last active Nov 8, 2019
Bootstrap 4 menus in WordPress via filters. No walker needed!

Bootstrap 4 menus in WordPress with filters

No walker needed!

This snippet allows you to create Bootstrap 4 menus without the use of a Walker. Instead, we're using filters to leverage WordPress core functionality as much as possible. Basically, all you need to do is this and you're done:

<nav class="navbar navbar-expand-lg fixed-top">
  <div class="container">
    <a class="navbar-brand" href="<?php echo home_url(); ?>">
jakebellacera / ICS.php
Last active Nov 5, 2019
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
View ICS.php
* This is free and unencumbered software released into the public domain.
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
jakebellacera /
Last active Sep 27, 2019
Learn how to get the ID of any YouTube video.

How to get the ID of any YouTube Video

This article walks you through how to get the ID of any YouTube video.

How to get a YouTube video ID from a page URL

You may be watching the video or just happened to visit a link to a video. The video ID will be located in the URL of the video page, right after the v= URL parameter.

jakebellacera / gmail-fluidapp-userscript.js
Last active Sep 16, 2019
An updated Fluidapp Userscript for Gmail
View gmail-fluidapp-userscript.js
// use for patterns:
// **
// **
// **mail*
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 15000);
function updateDockBadge() {
jakebellacera /
Created Aug 22, 2012
Instructions on how to use MAMP with the mysql2 gem and Ruby 1.9.3-p194 via rbenv

How to use MAMP with the mysql2 gem and Ruby 1.9.3-p194 via rbenv

Let's say you're a web developer who happens to work with both MAMP and Ruby when building different types of websites. Let's say you also like to keep your MySQL stuff in one place and don't like having to juggle both a local MySQL install as well as a MAMP MySQL install. Well, you can indeed connect your ruby apps to MAMP's MySQL. Here's a tutorial on how to do it.

Important! Before you do anything, download and install MAMP. MAMP Pro will work as well. At the time of this writing, MAMP 2.1.1 is the latest.

First, install Ruby via rbenv

  1. Install homebrew
  2. Install rbenv: brew install rbenv, follow any instructions homebrew gives you after the installation is complete.
jakebellacera / ajax-send.js
Created Feb 22, 2011
JQuery validate form that submits via AJAX
View ajax-send.js
ajax-send.js - copyright Jake Bellacera (
This script uses JQuery & JQuery Validate (
For this example, we will have a form named '#ajaxform', you can of course change this to whatever you'd like.
$('#submitbutton').click(function() {
View floodlight-click-handler.js
document.getElementById("button").addEventListener("click", function(e) {
var url = this.getAttribute("href", 2);
createFloodlightTag("source", "type", "cat", function() {
window.location = url; // Redirect the user after the tag successfully fires
function createFloodlightTag(source, type, cat, callback) {
jakebellacera /
Last active Jun 14, 2019
How to enable source maps for your browser.

How to enable source maps

Source mapping is a technique that "maps" your browser inspector's line numbers to the source file. This is useful when working with assets that are compiled from LESS, SASS, Coffeescript and so on. Source maps can also be used with minified assets that would normally have their line numbers removed. If you're curious, here's some more information regarding source maps.


  1. Open Developer Tools.
    • Mac users: View > Developer > Developer Tools.
  2. Click the Settings cog icon in the upper-right corner of the Developer Tools window.
  3. Under the Sources section, check the box(es) for the source maps you want to enable.
jakebellacera / jquery.placeholder.js
Created Jul 15, 2011
jQuery Placeholder Plugin - Fixes the placeholder attribute on non-supported browsers.
View jquery.placeholder.js
* Placeholder plugin for jQuery
* @author Daniel Stocks (
(function($) {
function Placeholder(input) {
this.input = input;
if (input.attr('type') == 'password') {
You can’t perform that action at this time.