Skip to content

Instantly share code, notes, and snippets.

View adamjgrant's full-sized avatar

Adam Grant adamjgrant

  • Software Engineer
View GitHub Profile
@adamjgrant
adamjgrant / boilerplate.js
Last active March 24, 2024 00:31
Handy Functions
// Name variables for their equivalent classnames.
// Assumes they have IDs with _ instead of -.
[].forEach((class_name) => {
const id_name = class_name.replace(/\-/g, '_');
window[id_name] = document.getElementById(id_name);
});
// Copy <templates> by ID.
const copy_from_template = (template_id) => document.getElementById(template_id).content.cloneNode(true).firstElementChild;
@adamjgrant
adamjgrant / code.js
Last active March 27, 2022 14:49
Airtable: Make Code
const ic = input.config();
const unique_sequential_id = ({
hexaduadec_digits_of_randomness_to_add = 2,
additional_sequence = "",
seed = Date.now() - 1635743663677
} = {}) => {
const digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
const calculate_hexaduadecimal = (base10_number, hexaduadecimal = "") => {

Keybase proof

I hereby claim:

  • I am adamjgrant on github.
  • I am adamgrant (https://keybase.io/adamgrant) on keybase.
  • I have a public key ASAq7u1DIcnxIggd3EemY-GddRf26TynZC_UOa2fjwSV_Qo

To claim this, I am signing this object:

{
"// info": "Wear a mask. Making this one interchangeable (beginning vs end)",
"main": [
{ "branch": "idea-1 clauses" },
{ "branch": "idea-2 clauses" },
{ "branch": "LEGACY" }
],
"// idea-1 info": "Not about masks specifically",
@adamjgrant
adamjgrant / idea-clause-synonym_tree.json
Last active May 13, 2021 05:03
2x2x2 tree template (2 ideas x 2 beginnings x 2 endings x many synonyms)
{
"// info": "Template for a 2x2x2 tree",
"main": [
{ "branch": "idea-1 clauses" },
{ "branch": "idea-2 clauses" }
],
"// idea-1 info": "",
"idea-1 clauses": [
@adamjgrant
adamjgrant / 1_rickandmorty.json
Last active April 5, 2021 04:45
[Monday February 15, 2021 09:00 AM] Permutations
{
"main": [
{
"branch": "I watched them all"
},
{
"branch": "admiration"
},
{
"branch": "quotes"
@adamjgrant
adamjgrant / rhetoric.json
Created January 12, 2021 21:34
Political rhetoric generation
{
"main": [
[
"My opponent is for ", {
"branch": "vote-againsts"
}
],
[
"I'm for ", {
"branch": "vote-fors"
@adamjgrant
adamjgrant / smosa-healthcare-heroes.json
Last active December 30, 2020 20:36
smosa-healthcare-heroes
{
"main": [
{
"ps": "I (just |)(hope|pray) there is (a light at the end of the tunnel|some hope in the end) for (healthcare workers|people working in healthcare) after (thanksgiving, Christmas, then New Years|three winter holidays in a row). What (do you think|is your take|are your thoughts), are we (almost out of the woods|about to turn a corner|going to see this all calm down soon|soon going to be out of harms way)?"
},
{
"ps": "(I think |)(We are|We're)(| definitely) not (almost out of the woods|about to turn a corner|going to see this all calm down soon|out of harms way) when it comes to (this virus|the coronavirus|COVID|the virus). (What|How) do you think we could (all |)do to (show|give) (some |)(appreciation for|respect to) (healthcare workers|people working in healthcare)?"
},
{
"ps": "(Some|I understand some) (healthcare workers|people working in healthcare) (don’t like being|prefer not to be|ask not to be) called “heroes”(| which is understandable), but (their
@adamjgrant
adamjgrant / smosa-exoplanets.json
Last active December 30, 2020 19:24
smosa-exoplanets
{
"main": [
{
"branch": "exoplanets",
"then": {
"ps": " are (teaching|showing|educating) us (a lot|a great deal|tremendously) (about|regarding) our own (solar system|part of the universe). (For example, t|T)here's a (chance|possibility) we (might|may|could) (actually |)(have|find ourselves with) a (ninth|9th) planet(, and its| whose) orbit is so (long|extended) we (just |simply |)haven't (found|discoverd) it yet. Do you (think|believe|assume) (it's|that's|it could be) possible?"
}
},
{
"branch": "since-we-started",
@adamjgrant
adamjgrant / smosa-climate.json
Last active December 30, 2020 16:02
smosa-climate
{
"main": [
{
"ps": "(Electric vehicles|EVs)( and plug-in hybrids| and hybrids|) are (gradually|slowly|over time) (being eclipsed by|being superceded by|losing popularity to) (hydrogen|H2) (power|fuel cells|powered-vehicles)( |...)(which|that|and it's true it) (kind of |sort of |)(has the best of|is the combined good of|is the best of both worlds,) gas and electric. (What about you, |)(Are you an EV driver|Do you drive an EV|Do you drive an electric)( yourself|)?"
},
{
"ps": "(One of|Among) the (underreported|lesser reported|less spoken of|less talked about|underdiscussed) (phenomena of|topics on|concerns of|worries of) (climate change|global warming|environmentalism) is (microplastics|nanoplastics). We're finding it (everywhere...|)in (food|seafood|animals|meat)( and even|) (human |)(babies|embryos)( now|). (What's your take|What do you think|What is your view) (on that|about that|on the matter)?"
},
{
"ps": "(We’re|We've been|We are) (really|pretty|very|quite) (intere