Skip to content

Instantly share code, notes, and snippets.

View krummja's full-sized avatar

Jonathan Crum krummja

View GitHub Profile
;; Theme Management
(use-package heaven-and-hell
:ensure t
:init
(setq heaven-and-hell-themes
'((light . doom-sakura-light)
(dark . doom-sakura-dark)))
(setq heaven-and-hell-load-theme-no-confirm t)
:hook (after-init . heaven-and-hell-init-hook))
from uuid import uuid1
class Entity:
def __init__(self):
self.uid = uuid1().hex
class componentmeta(type):
using System;
using System.Reflection;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using UnityEngine.EventSystems;
/// <summary>
from __future__ import annotations
from typing import *
import requests
import os
from hubspot3 import Hubspot3
from pprint import pprint
if TYPE_CHECKING:
pass
@krummja
krummja / request_loop.py
Created April 5, 2022 20:09
hubspot company request loop
def inspect_companies(
start: int = 0,
stop: int = 500
) -> Generator[Dict[str, Any]]:
if start > stop:
raise Exception(f"Expected start value less than stop. " +
f"Got {start} > {stop}")
url = "https://api.hubapi.com/crm/v3/objects/companies/search?"
select cdomain
into temp duplicates_2
from accounts
group by cdomain
having count(*) > 1;
select *
from duplicates_2
full join accounts
on duplicates_2.cdomain = accounts.cdomain;
create table combined_accounts_contacts
as select A.*,
B.company_id,
B.first_name,
B.last_name
from defaultdb_public_accounts A
full join defaultdb_public_contacts B
on A.external_id = B.company_id;
---
--- Combine tables in preparation for CSV export.
---
-- Stage 1: contacts, accounts => full join
-- ----------------------------------------
-- We need to make a new table that consists of all contacts and all companies,
-- since not all companies have associated contacts and vice-versa.
create table all_contacts_and_companies
-- Export Companies from Hubspot
-- Create a new table and import the CSV data
-- Create a new table with all Contact info, where we'll add the Company Hubspot ID as "Company HID"
-- Select all from existing contacts table
-- Left Join the table created from the exported CSV where contact company_id = exported Company EID
create table contacts_add_company_hid
as
select *
from defaultdb_public_contacts
@krummja
krummja / planet-generation.js
Created June 5, 2022 05:20
Delaunay Voronoi Sphere (from RedBlobGames)
/*
* From https://www.redblobgames.com/x/1843-planet-generation/
* Copyright 2018 Red Blob Games <[email protected]>
* License: Apache v2.0 <http://www.apache.org/licenses/LICENSE-2.0.html>
*/
'use strict';
/* global Delaunator, createREGL, vec3, mat4 */
const regl = createREGL({