- JSX produces React elements
-
"React embraces the fact that rendering logic is inherently coupled with other UI logic: how events are handled, how the state changes over time, and how the data is prepared for display."
- Separation of concerns by components that contain Markup and Logic (suck it, Angular!)
- React doesn't require JSX
- JSX is an expression (can be used in IF / FOR)
- Quotes XOR Curly Braces
- JSX prevents injection attacks e.g. XSS
- JSX is compiled by Babel to vanilla JS (
React.createElement()
calls) => React Element
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
#!python3 | |
class Subject: | |
def __init__(self, grade: int, credit: int): | |
self.g = grade | |
self.c = credit | |
#################################### | |
# CHANGE HERE # | |
#################################### |
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
#include <iostream> | |
#include <math.h> | |
using namespace std; | |
// Array Implementation |
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 moment = require('moment'); | |
const axios = require('axios').default; | |
const months = "januar februar marcius aprilis majus junius julius augusztus szeptember oktober november december".split( | |
" " | |
); | |
const getBibleVerse = async (ref) => { | |
const { data: html } = await axios.get( | |
`https://szentiras.hu/RUF/${ref.replace(" ", "")}`, |
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
#SingleInstance force | |
#NumpadAdd:: Send {Volume_Up} | |
#NumpadSub:: Send {Volume_Down} | |
#NumpadDot:: Send {Volume_Mute} |
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 localforage from 'localforage'; | |
import { AtomEffect, DefaultValue } from 'recoil'; | |
/** | |
* Recoil module to persist state to storage | |
*/ | |
export const recoilPersistLocalForage = ({ key = 'recoil-persist' }: { key?: string }): { persistAtom: AtomEffect<any> } => { | |
if (typeof window === 'undefined') { | |
return { | |
persistAtom: () => {}, |
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 puppeteer from 'puppeteer' | |
import fs from 'fs' | |
async function buildPDF(htmlString) { | |
const browser = await puppeteer.launch({ headless: true }) | |
const page = await browser.newPage(); | |
await page.setContent(htmlString, { waitUntil: 'networkidle0' }) | |
const pdf = await page.pdf({ | |
format: 'A4', | |
displayHeaderFooter: false, |
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
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
// ==UserScript== | |
// @name Songpraise 'Copy for ProPresenter' button | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description A userscript that adds a 'Copy for ProPresenter' button to Songpraise - it adds 2 buttons: one for copying and another for re-adding the copy button if something goes wrong (fixed position on the page) | |
// @author Tomi Olah | |
// @license GNU GPLv3 | |
// @match https://www.songpraise.com/ | |
// @icon https://www.songpraise.com/favicon.ico | |
// @grant GM_addElement |
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
/** Interface that encompasses all props returned by the creator function */ | |
interface ICBProps { | |
/** ID of the Timer that was created */ | |
id: number; | |
/** Function that stops the created timer */ | |
stop: () => void; | |
} | |
/** Type of a callback function that is aware of its own ID and can stop itself from within */ | |
type CBFn = (stop: ICBProps["stop"], id: ICBProps["id"]) => void; |
OlderNewer