Skip to content

Instantly share code, notes, and snippets.

View djyde's full-sized avatar
😾
Working on my full time job.

Randy djyde

😾
Working on my full time job.
View GitHub Profile
@djyde
djyde / .p10k.zsh
Last active March 6, 2023 09:20
env setup
# Generated by Powerlevel10k configuration wizard on 2023-03-06 at 09:04 UTC.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 16558.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, dark,
# 24h time, angled separators, sharp heads, flat tails, 2 lines, solid, right frame,
# sparse, few icons, concise, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
@djyde
djyde / remove-all-tweets.js
Created January 21, 2023 04:15
Readwise scripts
async function getBooks(category) {
return await (await fetch(`/api/books/?category=${category}`)).json()
}
async function deleteBook(id) {
return await (await fetch(`/api/user_delete_book`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'X-CSRFToken': Cookies.get('csrftoken')
@djyde
djyde / keybase.md
Created November 1, 2022 17:19
keybase.md

Keybase proof

I hereby claim:

  • I am djyde on github.
  • I am randylu (https://keybase.io/randylu) on keybase.
  • I have a public key ASB3NHl259pgMnRkOGrRa_5iZA-Ei65qXCFCQ7qj_7HAaAo

To claim this, I am signing this object:

@djyde
djyde / test.ts
Created March 24, 2021 13:43
lww-test
test("merge - scene#1", async () => {
let cloud = new Graph();
// initial state on cloud
const v1 = cloud.addVertex("v1");
const v2 = cloud.addVertex("v2");
const v3 = cloud.addVertex("v3");
const v4 = cloud.addVertex("v4");
// sync from cloud
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@djyde
djyde / webclips.js
Created January 26, 2021 05:04
Roam scripts
// get current document title and url and transform to Roam
const copyToClipboard = str => {
const el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
el.select();
@djyde
djyde / README.md
Last active January 23, 2021 12:04
My personal Saas docker setup
  1. Copy this compose file
  2. Setup folder:
mkdir dbdata
@djyde
djyde / README.md
Last active February 22, 2021 14:10
Singleton helper for next.js

Synchronous

const prisma = singletonSync('prisma', () => {
  return new PrismaClient()
})

Asynchronous