Skip to content

Instantly share code, notes, and snippets.

@jonasfroeller
jonasfroeller / .gitignore
Last active June 28, 2023 16:36
windows, linux and webdevelopment .gitignore
## Windows ###
# src: https://www.toptal.com/developers/gitignore/api/windows
# Windows thumbnail cache files
**/*Thumbs.db
**/*Thumbs.db:encryptable
**/*ehthumbs.db
**/*ehthumbs_vista.db
# Dump file
@jonasfroeller
jonasfroeller / .adoc
Created April 27, 2023 07:49
asciidoc preamble

${1:project}

@jonasfroeller
jonasfroeller / fetch_all_starred_repos.js
Last active June 28, 2023 16:34
A js script that fetches every starred repo of a github user with a GITHUB_TOKEN and wites the urls into a html file.
const axios = require('axios');
const fs = require('fs');
const GITHUB_TOKEN = 'AUTH-KEY';
const MAX_REQUESTS_PER_HOUR = 5000;
const REQUESTS_PER_MINUTE = 60;
const RATE_LIMIT_DELAY = 60 * 1000 / REQUESTS_PER_MINUTE;
async function fetchStarredRepos(username) {
@jonasfroeller
jonasfroeller / fetch_all_starred_repos.ts
Last active June 28, 2023 16:33
A ts script that fetches every starred repo of a github user and wites the most important data it into a html file.
// to run the file:
// npm install -g ts-node
// ts-node filename.ts
import axios from 'axios';
import fs from 'fs';
interface Repo {
id: number;
name: string;
@jonasfroeller
jonasfroeller / delete-node_modules.bat
Created June 28, 2023 16:20
delete all node_modules folders on your system (Windows)
@echo off
setlocal EnableDelayedExpansion
for /r %%d in (node_modules) do (
rd /s /q "%%d"
echo deleted "%%d"
)
pause
@jonasfroeller
jonasfroeller / delete-node_modules.sh
Created June 28, 2023 16:21
delete all node_modules folders on your system (Linux)
#!/bin/bash
find . -name "node_modules"
-type d -prune -exec rm -rf '{}' ;
read -p "Press Enter to exit..."
@jonasfroeller
jonasfroeller / delete-temp_data.bat
Created June 28, 2023 16:32
deletes temporary data on the system (Windows)
@echo off
REM setting temp path
set tmp_dir=%localappdata%\Temp
REM changing to temp dir
cd /d %tmp_dir%
REM deleting temporary files and directories
del /q /f /s *
@jonasfroeller
jonasfroeller / delete-temp_data.sh
Created June 28, 2023 16:32
deletes temporary data on the system (Linux)
#!/bin/bash
# changing to temp dir
cd /tmp
# deleting temporary files and directories
rm -rf *
read -p "Press Enter to exit..."
@jonasfroeller
jonasfroeller / cloudflare-i18n-ai-worker.js
Last active December 8, 2023 20:42
cloudflare i18n worker
import { Ai } from './vendor/@cloudflare/ai.js';
export default {
async fetch(request, env) {
const ai = new Ai(env.AI);
const url = new URL(request.url);
const textParam = url.searchParams.get('text');
const inputs = {
@jonasfroeller
jonasfroeller / even-columns.css
Created November 25, 2023 18:47
perfectly even columns
.even-columns {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 1fr;
}