This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME := Game | |
CFLAGS := -Wextra -Wall -Werror -Wunreachable-code -Ofast | |
LIBMLX := ./lib/MLX42 | |
HEADERS := -I ./include -I $(LIBMLX)/include | |
LIBS := $(LIBMLX)/build/libmlx42.a -ldl -lglfw -pthread -lm | |
SRCS := $(shell find ./src -iname "*.c") | |
OBJS := ${SRCS:.c=.o} | |
all: libmlx $(NAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect, useRef, useMemo } from 'react' | |
export default function Wordle() { | |
let [currentAttempt, setCurrentAttempt] = useState('') | |
let [bestColors, setBestColors] = useState(() => new Map()) | |
let [history, setHistory] = usePersistedHistory(h => { | |
waitForAnimation(h) | |
}) | |
useEffect(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="progress-bar"></div> | |
</div> | |
<button onclick="loadBar()">Load</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Hello World</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<!-- Don't use this in production: --> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
random.seed(100) | |
while True: | |
n=random.randrange(0,37,1) | |
if n == 0: | |
print("- Κληρώθηκε το 0.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
print("α, β και γ παριστάνουν σταθερούς αριθμούς και α δεν είναι 0") | |
a =int(input("Για το τριώνυμο αx²+βx+γ δώστε τον συντελεστή α: ")) | |
b =int(input("Για το τριώνυμο αx²+βx+γ δώστε τον συντελεστή β: ")) | |
c =int(input("Για το τριώνυμο αx²+βx+γ δώστε τον συντελεστή γ: ")) | |
d=b**2-4*a*c | |
print("Η διακρίνουσα Δ=β²-4αγ είναι ", d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Route } from 'react-router-dom' | |
import ListContacts from './ListContacts' | |
import CreateContact from './CreateContact' | |
import * as ContactsAPI from './utils/ContactsAPI' | |
class App extends Component { | |
state = { | |
contacts: [] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.addEventListener('install', function(event) { | |
event.waitUntil( | |
caches.open('wittr-static-v1').then(function(cache) { | |
return cache.addAll([ | |
'/', | |
'js/main.js', | |
'css/main.css', | |
'imgs/icon.png', | |
'https://fonts.gstatic.com/s/roboto/v15/2UX7WLTfW3W8TclTUvlFyQ.woff', | |
'https://fonts.gstatic.com/s/roboto/v15/d-6IYplOFocCacKzxwXSOD8E0i7KZn-EPnyo3HZu7kw.woff' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Using filter() | |
* | |
* Using the musicData array and filter(): | |
* - Return only album objects where the album's name is | |
* 10 characters long, 25 characters long, or anywhere in between | |
* - Store the returned data in a new `results` variable | |
* | |
* Note: | |
* - Do not delete the musicData variable | |
* - Do not alter any of the musicData content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fragment = document.createDocumentFragment(); // ← uses a DocumentFragment instead of a <div> | |
for (let i = 0; i < 200; i++) { | |
const newElement = document.createElement('p'); | |
newElement.innerText = 'This is paragraph number ' + i; | |
fragment.appendChild(newElement); | |
} | |
document.body.appendChild(fragment); // reflow and repaint here -- once! |
NewerOlder