Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View TheWebTech's full-sized avatar
🚀
Building big things

Jon McLaren TheWebTech

🚀
Building big things
View GitHub Profile
@TheWebTech
TheWebTech / dadjokes.csv
Created January 2, 2023 16:21
150 Dad jokes to import into a dad-abase.
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 2 columns, instead of 1. in line 8.
setup,punchline
When is New Year's Adam?,The night before New Year's Eve.
I attended a seminar last week about suppositories. ,"It wasn’t the most exciting seminar I’d ever attended, but it was right up there."
"When I teach in-person, students often laugh at my jokes. When I teach the same students online they don't laugh at all, so I asked them why.","They replied ""Because your jokes aren't remotely funny."""
"New year's resolutions - 2014: didn't jog, 2015: didn't jog, 2016: didn't jog, 2017: didn't jog, 2018: didn't jog, 2019: didn't jog, 2020: still didn't jog",I guess you could say this has been a running joke.
A man entered a local paper’s pun contest. He sent in 10 different puns in the hope that at least one of the puns would win. ,"Unfortunately, no pun in 10 did."
Puns about the body are generally corny...,but puns about the eyes are even cornea.
Lance is an uncommon name these days.,"But back in medieval times, people were called Lance a lot."
My son was eating lunch with a plastic fork and one o
@TheWebTech
TheWebTech / wf-action.js
Created January 1, 2023 22:11
Custom Code Workflow action to create a note on the current contact a year from the date they became a subscriber.
const axios = require("axios");
exports.main = async (event, callback) => {
// Pass in our private app token as a secret.
// https://developers.hubspot.com/docs/api/workflows/custom-code-actions#secrets
const privateAppToken = process.env.privateApp;
// Pass in properties to your custom coded action.
// https://developers.hubspot.com/docs/api/workflows/custom-code-actions#add-hubspot-properties-to-your-custom-code
const contact_id = event.inputFields["contact_id"];

I ran an obscure section template through GPT-3 and told it to explain to me what the code was doing. The code is below, and the response from GPT-3 is after the code.

<!--
  templateType: section
  label: Pricing
  isAvailableForNewContent: true
  screenshotPath: ../images/section-previews/pricing.png
  description: "Middle centered heading above three pricing cards, containing a subheading, description, and button each."
@TheWebTech
TheWebTech / CMS-hub-grid.css
Created May 10, 2022 21:22
HubSpot CMS - styles to better visualize the grid
/* CSS styles that highlight the hubspot grid components so you can better visualize what is happening in a page.
1. You could use this a few different ways, you could add this to your inspector-stylesheet.css when inspecting a page.
2. You could integrate this into a browser extension ;)
3. You could literally upload the stylesheet to HubSpot, and use {% if request.query_dict.hsDebug == "true" %}{{ require_css(PATH TO YOUR CSS FILE) }}{% endif %}
Additionally in-case it's useful as a prototyping/layout planning tool: https://codepen.io/thewebtech/pen/bGdrQyN??editors=1100
*/
.dnd-module {background: #eaf0f6;min-height: 50px!important; }
.dnd-module::before {content:"{% dnd_module %}";}

[00:00:00] Hey there. I just wanted to introduce you to the new CRM object property field. This field allows content creators to pick properties from a CRM object type. So think the properties of a product field, for example, it would have the product description unit costs when it was created who created it, et cetera.

[00:00:21] Then what this field actually does on the developer side is it gives you an object filled with all of the metadata for that property in the object. So where this is different from like say the CRM object field itself is that. This, doesn't give you the values of that object instead.

[00:00:46] It gives you the metadata. So it gives you like the label for that property. It gives you the actual property names. You can use it programmatically. It gives you the, the types. So say you want to do format [00:01:00] strings different than you did like integers. You can do that. So let's kind of dive into a little bit of a use case and, and how you could use this. So I created a module her

@TheWebTech
TheWebTech / hubspot_cos_bookmarklet.js
Last active March 14, 2018 14:20 — forked from spingary/hubspot_cos_bookmarklet.js
Hubspot COS Helper Bookmarklet
javascript: (function() {
var link = document.createElement("link");
link.href = "https://rawgit.com/spingary/060fcc7924ccdd21cc1b/raw/hubspot_cos_help_styles.css";
link.type = "text/css";
link.rel = "stylesheet";
var linkb = link.cloneNode(true);
document.getElementsByTagName("head")[0].appendChild(link);
var frame = window.frames['design-manager-iframe'];
var contents = jQuery(frame).contents();
jQuery('head',contents).append(linkb);