Skip to content

Instantly share code, notes, and snippets.

@jlayden
jlayden / social-share.js
Created September 7, 2022 21:34
jquery function for triggering modal windows to allow sharing a page to social media
// Copy Link
var $temp = $("<input>");
var $url = $(location).attr('href');
$('.copy-link').on('click', function() {
$("body").append($temp);
$temp.val($url).select();
document.execCommand("copy");
$temp.remove();
alert("Link copied!");
@jlayden
jlayden / html5-hero-video.markdown
Created November 18, 2021 23:50
HTML5 Hero Video

HTML5 Hero Video

Demo code of an HTML5 video as a background for a page element with content over the video -- a 'hero video.' Includes media queries to disable video on selected devices (e.g. mobile) with static image fallback and responsive scaling.

A Pen by Peter Breen on CodePen.

License.

@jlayden
jlayden / animated-underline-hover.markdown
Created November 3, 2021 02:55
Animated Underline Hover

Animated Underline Hover

Created an animated underline when you hover over a link. Fully customizable underline ie: color, size, spacing.

A Pen by Justin on CodePen.

License.

@jlayden
jlayden / gpa_calculator.s
Last active February 21, 2019 18:11
MIPS Assembly - Calculate Grade Point Average
###########################################################
# Lab 3
# Name: JOSEPH LAYDEN
# Date: 22 Feb 2019
#
# Description:
# Program Description
# A program that will ask the user to input a series of integers as
# course credit points earned and calculate the current GPA for this student.
# All credit points entered are in the range of [0,12] inclusive.
@jlayden
jlayden / meos_embargo.py
Last active March 14, 2019 17:04
CRUD (Create, Retrieve, Update, And Delete) HTTP methods for the ManpowerGroup Employment Outlook Survey hosted in HubSpot
#!/usr/bin/env python3
import requests
import json
import time
from urllib.request import urlopen
"""
CRUD (Create, Retrieve, Update, And Delete) HTTP methods for the
ManpowerGroup Employment Outlook Survey hosted in HubSpot
@jlayden
jlayden / post_publish.py
Created December 10, 2018 22:27
Publish, schedule or unpublish a blog post
import requests, json
# Set the API endpoint
HS_API_URL = "https://api.hubapi.com"
APIKEY_VALUE = "XXX"
APIKEY = "?hapikey=" + APIKEY_VALUE
PORTAL_ID = "XXX"
# Global JSON actions
PUBLISH = {"action": "schedule-publish"}
@jlayden
jlayden / hs_api_create_post.py
Last active December 10, 2018 21:06
Create blog post using HubSpot APIs
from urllib.request import urlopen
import json
import requests
# Define blog IDs as global variables
TEMPLATE_ID = XXX # HubSpot Templates
MANPOWERGROUP_ID = XXX # ManpowerGroup
MEOS_ID = XXX # ManpowerGroup Employment Outlook Survey
WEF_ID = XXX # World Economic Forum
@jlayden
jlayden / embargo-widget.html
Created December 7, 2018 15:21
MEOS Embargo
<!-- SET GLOBAL VARIABLES -->
{% set table_id = module.hubdb_id %}
{% set quarter = module.quarter %}
{% set year = module.year %}
{% set date = module.date %}
{% set embargo_date = module.embargo_date %}
{% set url_prefix = module.url_prefix %}
{% set url_suffix = module.url_suffix %}
{% set queryparams = "&year__eq=" ~ year ~ "&quarter__eq=" ~ quarter %}
@jlayden
jlayden / formSaver.js
Created November 16, 2018 16:32
Save a form to JSON file (Client-side only!!!)
/*!
* form-saver v8.3.0: Save and reuse form data
* (c) 2016 Chris Ferdinandi
* MIT License
* https://github.com/cferdinandi/form-saver
*/
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
@jlayden
jlayden / api.py
Created November 8, 2018 22:10
Example of how to use HTTP methods(verbs?)
import json, os, future
from collections import OrderedDict
from upstox_api.utils import *
import websocket, threading
import logging
from datetime import date, datetime
import requests
from requests.auth import HTTPBasicAuth