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:

@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-space-x.json
Created December 30, 2020 14:24
smosa-space-x
{
"main": [
{
"ps": "What did you think the first time you saw the backwards-looking landing of a Space X rocket?"
},
{
"ps": "Do you think we’ll have safer space travel with the new Space X vehicles over the space shuttle?"
},
{
"ps": "We’re about to have a huge surge of satellites in orbit around Earth. More so than ever. Do you think that will be an overall positive for life on earth?"
@adamjgrant
adamjgrant / smosa-science-communication.json
Created December 30, 2020 14:23
smosa-science-communication
{
"main": [
{
"ps": "Good science communication is sorely in need with misinformation being a bigger problem than ever. Have you noticed any of your family or friends falling prey to bad science?"
},
{
"ps": "I hope we can improve scientific literacy for the next generation. Misunderstanding science can do real harm. What do you think is most pervasive in terms of misinformation?"
},
{
"ps": "Be vigilant in the fight against misinformation. Good science communication is key. How do we reach more people and educate the public on the facts?"
@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",