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 stringio = require('@rauschma/stringio'); | |
const child = require('child_process'); | |
const start = child.spawn(`java -Xms512M -Xmx1024M -jar ./TEST-FILE.jar`, | |
[], { shell: true }); | |
async function writeToWritable(writable, data) { | |
console.log("WRITABLE", writable); | |
//await stringio.streamWrite(writable, data); |
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
<script context="module"> | |
// this script fetch the posts from the api | |
// https://svelte.dev/docs#script_context_module | |
// this is runned on load (check svelKit doc) | |
export async function load({ fetch }) { | |
let articles; | |
try { | |
// here you should type your dev.to username |
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
<script context="module"> | |
export async function load({ fetch, page }) { | |
let article; | |
try { | |
// here we are gonna fetch the single article by id | |
article = await fetch(`https://dev.to/api/articles/${page.params.slug}`); | |
article = await article.json(); | |
} catch (e) { |
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, { useState } from 'react' | |
export const Component = () => { | |
const [show, setShow] = useState(false) | |
const handleClick = () => { | |
setShow(prev => !prev) | |
} | |
return ( |
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, { useState } from 'react' | |
export const Component = () => { | |
const [show, setShow] = useState(false) | |
const handleClick = () => { | |
setShow(prev => !prev) | |
} | |
return ( |
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, { useState } from 'react' | |
export const Component = (props) => { | |
return ( | |
<div> | |
<p>{props.name}</p> | |
<p>{props.surname}</p> | |
<p>{props.age}</p> | |
<p>{props.location}</p> |
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, { useState } from 'react' | |
export const Component = ({name, age}) => { | |
return ( | |
<div> | |
<h2>{name}</h2> | |
<p>{age}</p> | |
</div> | |
) |
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
let obj = {} | |
const symbol1 = Symbol("a") | |
const symbol2 = Symbol("a") | |
const sharedSymbol = Symbol.for('b') | |
obj[symbol1] = 'a' | |
obj[sharedSymbol] = 'b' | |
obj['c'] = 'c' |
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
Symbol('bar') === Symbol('bar') // false, each of them it's a unique id, the "bar" it's just a description and not an unique key | |
Symbol.for('foo'); // create a new global symbol | |
Symbol.for('foo'); // retrieve the already created symbol | |
Symbol.for('bar') === Symbol.for('bar') // true |
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
<html> | |
<head> | |
<title>Party Coffee Cake</title> | |
<script type="application/ld+json"> | |
{ | |
"@context": "https://schema.org/", | |
"@type": "Recipe", | |
"name": "Party Coffee Cake", | |
"author": { | |
"@type": "Person", |
OlderNewer