Skip to content

Instantly share code, notes, and snippets.

View marlomajor's full-sized avatar

Marlo Major marlomajor

View GitHub Profile

Project: Ruby Fundamentals CLI

Overview:

You'll create an interactive Ruby console application that allows users to explore the basics of the Ruby object model, manipulate different data types, and apply the concepts learned from the Honeybadger blog post on the Ruby object model. This console app will accept user input and perform actions based on that input, such as creating objects, manipulating strings and arrays, and performing calculations.

Part 1: Setting Up and Exploring Objects

Read the Honeybadger blog post on the Ruby object model to understand the basics of objects, classes, and modules in Ruby. Set up a new Ruby script file (explorer.rb). Write a simple ObjectExplorer class that will interact with the user through the command line. For now, it should greet the user and accept input.

@marlomajor
marlomajor / Homework_5
Created December 2, 2021 15:53
VolcanoCoin.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract VolcanoCoin is ERC20("Volcano Coin", "VOL"), Ownable{
constructor() {
_mint(msg.sender, initialSupply);
@marlomajor
marlomajor / VolcanoCoin.sol
Created November 15, 2021 05:05
Encode Homework_4
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
contract VolcanoCoin {
uint public totalSupply = 10000;
address owner;
mapping(address => uint) public balances;
error Unauthorized();
constructor() {
@marlomajor
marlomajor / VolcanoCoin.sol
Last active November 11, 2021 06:27
Homework_3
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7; // Homework said ^0.8.0, but he also said choose latest available to us, so going with ^0.8.7
contract VolcanoCoin {
// initialize owner in constructor
constructor() { owner=msg.sender; }
// set variables for totalSupply and ownerAddress
uint totalSupply = 10000;
address owner;
0x7c263f45E8F33e726b2884992Aeff473F2A5AAFc

JavaScript Functions

I can explain the difference between function declarations and function expressions.

  • YES. Pretty pumped about knowing the difference also. Fixed a huge problem in my Gametime project because I was using a function expression when I should have been using a declaration.

I can explain what the value of this is in a normal function.

  • Yes.

I can explain what the value of this is when called from the context of an object.

  • Yes.
@marlomajor
marlomajor / jQuery.md
Created March 26, 2016 23:41
jQuery Fundamentals

What is something you learned that was particularly suprising/interesting?

I've used many of the topics covered in this tutorial already, but didn't realize the impact they had for the JS language. For example, being able to change an objects properties at any time was interesting.

What was something you already knew?

Pretty much the beginning of this tutorial was all review, especially after reading Speaking Javascripts chapters first.

Was there anything you feel as though you still don't understand?

This is a comment made in class and I've seen this at a meetup. But what's the difference between getter and setters? Also, what is addBack used for?

@marlomajor
marlomajor / speakingJs.md
Created March 26, 2016 23:36
Speaking JS

Which sections were interesting?

I love the chapter on Functions. I ended up taking copious notes on this chapter. It has helped to clarify a ton of misconceptions to me

Which sections did you totally skim?

I only skimmed the end of Functions, I think it was titled "Named Parameters" as I didn't think that I could relate to it much. I still took notes on this part however, I will come back to it I'm sure.

Do you think the reading was valuable?

This reading is helping me to Speak Javascript...literally. It is super valuable. But probably only after having built several JS projects. To newcomers to module four, I can see how it would be less valuable, as they probably don't have much context

Which topics were notably confusing?

@marlomajor
marlomajor / gist:23b539e3b199dac84bad
Created March 26, 2016 20:05
Sandi Metz Rules for Developers

Summary

Sandi Metz rules were all interesting and clearly demonstrated that simple is usually better. The rules were that classes should have no more than 100 LOC, methods should have no more than 5LOC (including if/else statements), a controller should instantiat only one method, and that methods should have no more than four parameters passed into the method.

Hardest Rules to Follow

The hardest of Sandi's rules to follow will be keeping methods to <= 5 LOC and instantiating only one object in a controller. My methods are typically not refactored well and extremely long, simply because I'm trying to get my thoughts on the page and rarely have time to refactor. Concerning the one object controller, its just not something I'm used to doing. But getting used to instantiating only one object feels as though its something I can eventually get used to. The hardest rule for Thoughtbot to follow (the only rule they ended up reverting to "Rule 0" for was the four method arguments rule. In rail, form_for and li

##Leap My code: here

  • Responder #1 (here) - This approach is significantly more simple than mine. The creater uses a one line function that includes an or/and operator and returns true.
  • Responder #2 (here) - This programmer assigns an anonymous function to a variable. Afterwards, she uses an if/elseif/else statement to check for each occurence.
  • Responder #3 (here) - This programmer also used an if else statement to accomplish the same task. Main difference is that the first statement is a check to make sure the year is divisible by 4. The nested if statement then checks for the other functionality.
  • Responder #4 (here) - This programmer uses one if statement to check for di