Skip to content

Instantly share code, notes, and snippets.

@trevor-atlas
Last active November 15, 2021 16:05
Show Gist options
  • Save trevor-atlas/a1d251016877c2b94fc977a84efaf4bf to your computer and use it in GitHub Desktop.
Save trevor-atlas/a1d251016877c2b94fc977a84efaf4bf to your computer and use it in GitHub Desktop.
get a random icebreaker for standup
const colors = {
Reset: '\x1b[0m',
Bright: '\x1b[1m',
Dim: '\x1b[2m',
Underscore: '\x1b[4m',
Blink: '\x1b[5m',
Reverse: '\x1b[7m',
Hidden: '\x1b[8m',
FgBlack: '\x1b[30m',
FgRed: '\x1b[31m',
FgGreen: '\x1b[32m',
FgYellow: '\x1b[33m',
FgBlue: '\x1b[34m',
FgMagenta: '\x1b[35m',
FgCyan: '\x1b[36m',
FgWhite: '\x1b[37m',
BgBlack: '\x1b[40m',
BgRed: '\x1b[41m',
BgGreen: '\x1b[42m',
BgYellow: '\x1b[43m',
BgBlue: '\x1b[44m',
BgMagenta: '\x1b[45m',
BgCyan: '\x1b[46m',
BgWhite: '\x1b[47m',
};
module.exports = colors;
const icebreakers = require('./icebreakers.json');
const completeIcebreakers = require('./complete-icebreakers.json');
const fs = require('fs');
const util = require('util');
const write = util.promisify(fs.writeFile);
const complete = { ...completeIcebreakers };
const colors = require('./colors');
const getRandomElement = (arr) => {
const index = Math.floor(Math.random() * arr.length);
const item = arr[index];
return [index, item];
};
function colorString(color, string) {
return `${color}${string}${color.Reset}`;
}
(async function main() {
let [index, item] = getRandomElement(icebreakers);
let iterations = 0;
while (index in complete) {
if (iterations >= icebreakers.length) {
console.error(
colorString(
colors.FgYellow,
'🚨 No more unique icebreakers left to choose from'
)
);
break;
}
[index, item] = getRandomElement(icebreakers);
iterations++;
}
console.log(`🚀 "${item}"`);
if (index in complete) {
complete[index] += 1;
} else {
complete[index] = 1;
}
const content = JSON.stringify(complete, null, 2);
await write('complete-icebreakers.json', content, {
encoding: 'utf8',
});
})();
[
"Show us the weirdest thing you have in the room with you right now.",
"There is a free, round-trip shuttle to Mars. The catch: it will take one year of your life to go, visit, and come back. Are you in?",
"What is your least favorite thing about technology?",
"What superpower would you most want?",
"What food is best with cheese?",
"Would you go in the mother-ship with aliens if they landed on Earth tomorrow?",
"Would you join a community in space if it was permanent?",
"Would you rather live 100 years in the past or 100 years in the future?",
"You are the best criminal mastermind in the world. What crime would you commit if you knew you would get away with it?",
"You can only eat one food again for the rest of your life. What is it?",
"You can visit any fictional time or place. Which would you pick?",
"In your time as a student in K-12, what made an impact on you. Not who, but what? What do you remember that influenced you today?",
"How would you hide a giraffe from the government?",
"If you were an inanimate object, what would you be and why?",
"What is the most trivial thing about which you have a strong opinion?",
"What is the smallest thing for which you are grateful?",
"If you could change one thing about yourself physically, what would you change?",
"What single event or decision do you think most affected the rest of your life?",
"What do you fear, despite having no real reason to do so? Basically, what is an irrational fear you have?",
"Do you have any conspiracy theories? If so, what are they?",
"What scientific or technological advance blows your mind? Is there any technology that seems so futuristic and advanced you're surprised it actually exists?",
"What is something you don't realise is weird until you really think about it?",
"You can transport one furious elephant into any point in history, where would you put it?",
"If you could make one thing that is now legal, illegal, and one thing that is illegal, legal, what laws would change?",
"Would you agree to go without showering, brushing your teeth, and using deodorant for six months to win $50,000? You are not allowed to talk about the deal with anyone until the six months end, or the offer is gone.",
"What’s the best trip (traveling wise) you ever had?",
"Does pineapple go on pizza?",
"If you could live anywhere in the world for a year, where would it be?",
"What’s your favorite seat on an airplane?",
"What is your spirit animal? (The animal who is most similar to your personality.)",
"What is your favorite thing to do by yourself?",
"Have you ever experienced a natural disaster like a hurricane or tornado?",
"If you had to delete all but 3 apps from your smartphone, which ones would you keep? (Three apps that have changed your life.)",
"If you had to choose between only having a cell phone or a car for the rest of your life, which would you choose?",
"What is your favorite tv series?",
"What is your favorite book?",
"How would you change your life today if the average life expectancy was 400 years?",
"A genie grants you three wishes but none of them can directly benefit you. What would those wishes be?",
"What is your favorite smell and why?"
]
@trevor-atlas
Copy link
Author

note: You may need to chmod 755 complete-icebreakers.json for the updates to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment