Skip to content

Instantly share code, notes, and snippets.


Gianmarco Ladvace

View GitHub Profile
View [slug].svelte
<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(`${page.params.slug}`);
article = await article.json();
} catch (e) {
View index.svelte
<script context="module">
// this script fetch the posts from the api
// this is runned on load (check svelKit doc)
export async function load({ fetch }) {
let articles;
try {
// here you should type your username
View gist:2696336bf36c8259b82189273dc93c6f
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);