This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
this is a macro that will need to do some heavy lifting to continue this | |
proof of concept into more complex code | |
--> | |
{%- macro importjs(module_name) -%} | |
{{- widget_data.importjs[module_name] -}} | |
{%- endmacro -%} | |
<!-- | |
This is a sample output of widget_data.importjs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This is the global FAQ module --> | |
{% module | |
"global_faq" | |
path="../../modules/global/global-faq.module", | |
label="global-faq" | |
export_to_template_context=True | |
%} | |
<!-- | |
this is how it looks in design manager: https://share.cleanshot.com/PxD7wBWK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# depending on how you set up your project, having the ** here will make sure | |
# to cover your entire project | |
**/node_modules/ | |
# HubSpot config file | |
**/hubspot.config.yml | |
**/hubspot.config.yaml | |
# this is a file that keeps the packages in your project in sync | |
# if you want to make sure everyone is using the same version of packages it is a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
lerna-debug.log* | |
# Diagnostic reports (https://nodejs.org/api/report.html) | |
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const canvas = document.createElement("canvas"); | |
const gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl"); | |
if (gl) { | |
const debugInfo = gl.getExtension("WEBGL_debug_renderer_info"); | |
if (debugInfo) { | |
const renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL); | |
console.log("WebGL renderer:", renderer); | |
// If renderer string contains "SwiftShader" or "Software", hardware acceleration may be disabled. | |
} else { | |
console.log("WEBGL_debug_renderer_info not available."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I console log all of this stuff in a way that I can easily understand where errors are | |
// coming from as well as the data this is being passed in. This is super helpful when you are | |
// trying to debug and figure out what is going wrong. I want into much more detail than I really | |
// wanted to here. I started this to not use the hubspot sdk, because I see no reason to use it | |
// if we already have axios installed. | |
// In my opinion it isn't worth using the hubspot sdk because there is a history of | |
// different versions of the sdk being available in serverless functions, workflows, and what | |
// is available for the newest version of the sdk. This can cause MAJOR ISSUES when you are | |
// trying to debug and figure out what is going wrong only to learn that this version of the sdk | |
// isn't supported in one of these environments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _hsq = window._hsq = window._hsq || [] | |
_hsq.push(["identify", { | |
email: "[email protected]", | |
firstname: "sample", | |
lastname: "code" | |
}]) | |
_hsq.push(['trackPageView']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
This is my new favorite "Days Ago" but converted for partner portals where | |
action is needed and those "sales people" are out there hunting. They see | |
a "15 minutes" ago on a date property... whatever | |
#} | |
{% macro timeAgoSmart(date) %} | |
{%- set difference = local_dt|unixtimestamp - date|unixtimestamp -%} | |
{%- set minutes = (difference / 60000)|round(0, 'floor') -%} | |
{%- set hours = (difference / 3600000)|round(0, 'floor') -%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Here’s a function that takes the GraphQL response and calculates the required totals for the company and affiliates: | |
function processPipelineData(data) { | |
if (!data || !data.CRM || !data.CRM.contact || !data.CRM.contact.associations) { | |
return { companyPipeline: {}, affiliatePipeline: {} }; | |
} | |
const companyData = data.CRM.contact.associations.company?.items[0]; | |
if (!companyData || !companyData.associations) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas as pd | |
import time | |
def fetch_players(gender): | |
base_url = "https://drop-api.ea.com/rating/ea-sports-fc?locale=en&limit=100&gender=" | |
offset = 0 | |
all_players = [] | |
while True: |
NewerOlder