Skip to content

Instantly share code, notes, and snippets.

@chrisbridges
chrisbridges / main.py
Created May 12, 2025 17:57
Thoughtful Code Screen
def sort(width: float, height: float, length: float, mass: float) -> str:
"""
Dispatches a package to STANDARD, SPECIAL, or REJECTED based on its dimensions and mass.
- Bulky: volume >= 1_000_000 cm³ OR any dimension >= 150 cm
- Heavy: mass >= 20 kg
- Both heavy and bulky: REJECTED
- Either heavy or bulky: SPECIAL
- Otherwise: STANDARD
"""
@chrisbridges
chrisbridges / example_solution.js
Last active February 18, 2019 21:08
Learning Arrays Example Solution
// Write an array that contains the names of some of your friends
let friends = ['Chris', 'Conner', 'Cassandra']
// Add a friend to the end of that array
friends[3] = 'Jonathan'
// Replace one friend's name with another name
friends[1] = 'Justin' // sorry Conner
// Determine the length of your friends array by using the Array.length method
# Declare two variables (using snake-case) that store your name and age
name = 'Chris'
age = 26
# Write a variable (containing a boolean) that states whether or not you like dogs
likes_dogs = True
# Write a variable that contains your favorite number, and another that contains a float
fav_number = 12
cool_float = 23.76
@chrisbridges
chrisbridges / gist:6a23fe6c35d64b5db8a3a59e8798dfb2
Created March 4, 2018 18:04
User Feedback for RoadFlix app
Users were slightly confused by blank user movie list, so added placeholder text there to make it a little more clear,
both what action should be, and to make it clear what the section was.
Made things look less 'boxey'
add accent color to look less black and white
added shadow behind each poster to make them pop more
https://repl.it/@chris_bridges/area-of-a-rectangle-drill
https://repl.it/@chris_bridges/temperature-conversion-drill
https://repl.it/@chris_bridges/Is-divisible-drill
https://repl.it/@chris_bridges/Wiseperson-generator-drill
https://repl.it/@chris_bridges/shouter-drill
https://repl.it/@chris_bridges/text-normalizer-drill