Skip to content

Instantly share code, notes, and snippets.

View estevanjantsk's full-sized avatar
:shipit:

Estevan Jantsk estevanjantsk

:shipit:
  • Tallinn
  • 03:32 (UTC +03:00)
View GitHub Profile
@arajkumar
arajkumar / dummy-pr.sh
Last active December 2, 2022 13:29
Create dummy PR
set -e
BRANCH="dummy-$(date +%Y.%m.%d-%s)"
git fetch origin master && git checkout -b $BRANCH FETCH_HEAD
touch ${BRANCH}
git add ${BRANCH} && git commit -m "chore: Dummy PR to retrigger CI"
git rm ${BRANCH} && git commit -m "chore: Dummy PR to retrigger CI"
git push fork $BRANCH --force
@agmm
agmm / nextjs-file-upload-api.js
Created January 31, 2020 23:03
Simple Nextjs File Upload — Backend API
// Backend
import formidable from 'formidable';
export const config = {
api: {
bodyParser: false,
},
};
export default async (req, res) => {
@DaniruKun
DaniruKun / .iex.exs
Created January 31, 2023 16:44
My custom global IEx script file that is preloaded before each IEx session. Adds some convenience functions.
IO.puts("Using .iex.exs file loaded from #{__DIR__}/.iex.exs")
defmodule Util do
def atom_status do
limit = :erlang.system_info(:atom_limit)
count = :erlang.system_info(:atom_count)
IO.puts("Currently using #{count} / #{limit} atoms")
end
@gimenete
gimenete / safeParse.ts
Last active March 15, 2024 16:05
A wrapper around the fetch function that validates the response body against a Zod schema
import z from "zod";
export async function safeFetch<T>(
schema: z.Schema<T>,
input: RequestInfo,
init?: RequestInit
): Promise<T> {
const response = await fetch(input, init);
if (!response.ok) {
@planetoftheweb
planetoftheweb / README prompt generator
Created July 6, 2024 15:52
Prompt for Generating README files using Chat GPT
You're a professional and experienced web developer and open source contributor. Create a first release README document for these files. The target audience is professional developers with five years of experience building online projects.
- Include a description
- A list of interesting techniques the code uses in the files provided. When possible link to MDN documentation as part of the text of the technique.
- A list of non-obvious technologies or libraries used in the code that would be of interest to professional developers with medium level experience.
- Make sure you add links to external libraries, including links to any specific fonts used.
- A breakdown of the project structure as a directory list code block: Include directories like any images directories or subfolders implied by the code, but not individual files unless they're in the root directory. Add a short description of any interesting directories underneath the code block
- If you mention a file or directory in the description, link to the