Skip to content

Instantly share code, notes, and snippets.

View sandrabosk's full-sized avatar
👩‍💻
Always a student, never a master. Have to keep moving forward. ~C.Hall

Aleksandra Bošković sandrabosk

👩‍💻
Always a student, never a master. Have to keep moving forward. ~C.Hall
  • Ironhack
View GitHub Profile
@ross-u
ross-u / index.js
Last active May 1, 2020 13:49
localStorage - example 01/20
function updateScore(name, score) {
// GET PREVIOUS SCORE
let previousScore = JSON.parse(localStorage.getItem("score"));
if (!previousScore) {
previousScore = [];
}
// UPDATE THE SCORE
const newScore = { name, score };
@ross-u
ross-u / index.html
Last active October 21, 2020 14:19
Semantic HTML example
<!DOCTYPE html>
<html>
<head>
<title>Semantic HTML</title>
<meta charset="UTF-8" />
</head>
<body>
<nav>
<a href="">Home</a>
@santisbon
santisbon / Search my gists.md
Last active April 26, 2024 18:39
How to #search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@klikstermkd
klikstermkd / player.js
Last active February 8, 2023 12:11
Compare two ways of getting previous state from a React component, when setting its new state.
class Player extends React.Component {
constructor() {
super()
this.state = { score: 0 }
}
increaseScore() {
// 1. Get previous state from this.state
this.setState({ score: this.state.score + 1 })