Skip to content

Instantly share code, notes, and snippets.

View yafkari's full-sized avatar
🎯
Focusing

Younes yafkari

🎯
Focusing
View GitHub Profile
@yafkari
yafkari / sitemap.xml.js
Created January 19, 2020 11:16
Simple sitemap.xml file for Svelte/Sapper blog project
import posts from "./blog/_posts";
const fs = require('fs');
const BASE_URL = "https://www.zechtyounes.tech"; // TO CHANGE
const pages = [""];
fs.readdirSync("./src/routes").forEach(file => {
file = file.split('.')[0];
if (file.charAt(0) !== '_' && file !== "sitemap" && file !== "index") {
pages.push(file);
@yafkari
yafkari / quicktool.py
Last active November 26, 2018 15:15
quick tool to list all the sounds found in the res folder for the bobot project
import os
for file in os.listdir("."):
if(file.split(".")[1] == ".mp3"):
text = "\"{}\": {{\n\t\"path\": \"./res/sounds/{}\"\n}},\n".format(file.split(".")[0], file)
with open('sounds.json', 'a+') as file:
file.write(text)