Skip to content

Instantly share code, notes, and snippets.

View DakotaLMartinez's full-sized avatar

Dakota Lee Martinez DakotaLMartinez

View GitHub Profile
@DakotaLMartinez
DakotaLMartinez / INPUT.md
Created July 14, 2023 19:52
README from github diff GPT-3.5

Split Unified Showing 6 changed files with 198 additions and 6 deletions.

15 changes: 15 additions & 0 deletions 15
...ss-control/job-application-tracker-api/migrations/20230713150352-add_password_to_users.js @@ -0,0 +1,15 @@ "use strict";

@DakotaLMartinez
DakotaLMartinez / computer.rb
Last active July 20, 2021 15:36
computer class
class Computer
# setter
def computer=(brand, screen_size, model_name, model_year)
@brand = brand,
@screen_size = screen_size
@model_name = model_size
@model_year = model_year
end
# getter
const [imgUrl, imgUrlSetter] = useState("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/300px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg");
const [title, titleSetter] = useState("Mona Lisa");
const [artistName, artistNameSetter] = useState("Leonardo Da Vinci");
const [date, dateSetter] = useState("c. 1503–1506, perhaps continuing until c. 1517");
const [width, widthSetter] = useState("21");
const [height, heightSetter] = useState("30");
describe ".make_yourself_a_fan_of_the_black_eyed_peas" do
it "adds your name to the fans table as a fan of the black eyed peas (ArtistId **169**)" do
Query.run(:make_yourself_a_fan_of_the_black_eyed_peas)
black_eyed_peas_fans = Query.run("SELECT * FROM fans WHERE artist_id = 169").map{|row| row["name"]}
expect(black_eyed_peas_fans).to include("REPLACE ME WITH YOUR NAME")
end
end
@DakotaLMartinez
DakotaLMartinez / instructions.md
Last active May 20, 2024 23:48
Adding an SSH key to GitHub (Mac OS X or Linux)

You need to do this if you try this command:

ssh -T git@github.com

and you get something that says

git@github.com: Permission denied (public key).
@DakotaLMartinez
DakotaLMartinez / README.md
Last active May 20, 2021 02:16
Handling Events In React

Handling Events

To get a sense of how we handle events in react, let's take a closer look at what an event looks like in vanilla JavaScript and compare it to what we see with react. To do that, let's create a button and add a click event listener to it. When the button is clicked, we'll log event to the console.

Open up a new CodeSandbox and try the exercise below with me. In vanilla JS, we have a couple of choices for how we want to attach an event listener. We can either add an html attribute directly to the element we want to target, as below:

<button onclick="console.log(event)">Click Me</button>
@DakotaLMartinez
DakotaLMartinez / classList-set.md
Created December 23, 2020 17:41
How to Set the ClassList of a DOM element using a string

After writing a bunch of code like this:

this.actionButton.classList.add(..."px-4 bg-transparent p-3 rounded-lg text-indigo-500 hover:bg-gray-100 hover:text-indigo-400 mr-2".split(" "));

When building up javascript elements with lots of classes from html, I finally wised up and made a change:

DOMTokenList.prototype.set = function(classString) {
 this.add(...classString.split(" "));

Dependencies (Gems/packages)

omniauth
omniauth-google-oauth2
dotenv-rails

Configuration (environment variables/other stuff in config folder)

config/initializers/devise.rb

config.omniauth :google_oauth2, ENV['GOOGLE_OAUTH_CLIENT_ID'], ENV['GOOGLE_OAUTH_CLIENT_SECRET'],{
@DakotaLMartinez
DakotaLMartinez / rails_project_planning.md
Last active November 7, 2020 19:25
Rails Project Planning

What is the Many to many relationship and how is it used?

What is the User Submittable attribute on the join model?

What Validations do we need?

How do users fit into the application? How are they related to the other models?

What are our Nested Routes? (We need a nested new route and either a nested index or nested show route)

@DakotaLMartinez
DakotaLMartinez / vtx.md
Last active April 19, 2018 02:08
How to Enable VT-x for VirtualBox

Tutorial: How to enable VT-x

!!important!! This will require the student to adjust their BIOS/UEFI settings and screenshare will be impossible unless they can join screenshare session from their phone and point the camera at the screen. This also includes very time sensitive key presses, so it might take the student a few tries to get to the BIOS settings.

NOTE!! Some latop manufactures do not have the setting in the BIOS (try googling by their manufactor and chipset first before giving up), in this case the Virtual Box might not be a solution for them with their current PC. Some options for them might be: move to a native Linux environment, continue using the Learn IDE or try on a different Windows machine.

On Windows 10 or 8, you can configure UEFI firmware settings by triggering an advanced restart. Try opening the links for all the ways you can trigger it. I did it by going to the start menu -> set