Skip to content

Instantly share code, notes, and snippets.

View rubyr's full-sized avatar

Ruby Rinken rubyr

View GitHub Profile
function toRoman(num) {
if (num === 0) return "";
let numerals = {
M: 1000,
CM: 900, D: 500, CD: 400, C: 100,
XC: 90, L: 50, XL: 40, X: 10,
IX: 9, V: 5, IV: 4, I: 1,
};
for (const [key, value] of Object.entries(numerals))

What is a "framework?" And how does it differ from a "library?"

A framework is something you use in your code that does much of the routine work for you (most often, updating the DOM). A library is a set of features you can use in your code, but it doesn't necessarily replace or upgrade too many things.

Why should we consider using a framework over vanilla JS like you have been doing in mods 1 and 2?

Using a framework is so much easier than using vanilla JS. It allows you to abstract parts of code that you don't need to worry about, like dom manipulation and state handling. Using a library allows you to use less headspace for things you don't need to worry about, and instead focus on what's actually important.

What is a "component" in React? Why is it useful to have components?

A component is a block of code that has something to render. It can also contain a state, data, props, or really anything else - it's just a class that has some extra features. Components are useful because they allow us

DTR: Define the Relationship

Guiding Questions to Define The Relationship:

Project: Refractor Tractor

Group Member Names: Jeremiah, Edita, Ruby

Goals and Expectations for the Project (What does each group member hope to get out of this project? What do we want to achieve as a team? How will we know that we're successful?): Edita wants to struggle on the things she doesn't know but ultimately learn and grow as a developer. Jeremiah wants to become a master at pseudocoding and improve his technical language.

Pairin Survey results: inaginative-inspirational, reliant, bendy, lover of transcendence

What is your greatest strength and how do you know?

I'm very good at imagining and designing a thing and seeing what it would look like, how it would work, and the steps I'd need to make it a reality. The creative process is something very familiar to me, and I always love getting sucked into it. I'd say that's my greatest strength, that I can imagine something and know what I need to do to get that to work.

How do you work best?

I work best when I have an idea and a quiet space to work on getting that idea out of my mind. Usually this means putting on some music and letting myself go for anywhere from a couple of minutes to hours until I have what I'd imagined. When I can do this, I produce some of my best work. If I cannot, however, I generally an't focus and I end up either procrasti

@rubyr
rubyr / platformer_movement.gml
Last active February 23, 2019 08:03
simple platformer movement for gamemaker: studio (could work for other engines too, with some modifications)
/// CREATE EVENT
xx = 0; // xx and yy are velocities, for x and y respectively
yy = 0;
spd = 3; // pixels per frame; if using delta timing it will be pixels per second
impulsespd = 0.3; // play around with this
jump_impulse = -10; // negative, because up is negative on the Y
//note: GMS1 will have to define this in "define macros" under "resources"
@rubyr
rubyr / topdown_movement.gml
Last active July 21, 2023 00:24
simple 2d topdown player movement for gamemaker: studio games (and other engines too, if you adapt it)
/// CREATE EVENT
xx = 0; // xx and yy are velocities, for x and y respectively
yy = 0;
spd = 3; // pixels per frame; if using delta timing it will be pixels per second
impulsespd = 0.3; // play around with this
//note: GMS1 will have to define this in "define macros" under "resources"
#macro plrfriction 0.85
@rubyr
rubyr / responder.py
Last active May 18, 2018 15:17
Simple responder module, tracks previous responses and excludes them
import random
class Responder(object):
# list of all possible responses
responses = [
"no",
"yes",
"one",
"two",
"cool"