Skip to content

Instantly share code, notes, and snippets.

View jojojojojoj5564656465465's full-sized avatar

JONATHAN jojojojojoj5564656465465

View GitHub Profile
@jojojojojoj5564656465465
jojojojojoj5564656465465 / GIT config A USER
Created January 14, 2023 18:59 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@jojojojojoj5564656465465
jojojojojoj5564656465465 / cloudfare-worker-post-to-notion.js
Created July 2, 2022 02:51 — forked from Fredkiss3/cloudfare-worker-post-to-notion.js
Script for cloudfare worker to post to a notion database
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET,HEAD,POST,OPTIONS',
'Access-Control-Allow-Credentials': true,
};
const ALLOWED_HOSTS = [
// Put your allowed cors hosts here
// By default localhost is allowed
// Your fetch should have a `mode: cors` enabled for it to work
export async function jsonFetch<T>(
url: string,
options: RequestInit = {}
): Promise<T> {
// Set the default headers correctly
const headers: HeadersInit = new Headers(options.headers);
headers.set('Accept', 'application/json');
headers.set('Content-Type', 'application/json');
return fetch(url, {