Skip to content

Instantly share code, notes, and snippets.

@enepomnyaschih
enepomnyaschih / base64.js
Last active March 17, 2025 03:14
https://www.npmjs.com/package/byte-base64 - Encode JS Uint8Array, simple array of bytes or native JS string to base64 and back
/*
MIT License
Copyright (c) 2020 Egor Nepomnyaschih
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@tomaspozo
tomaspozo / lovable-knowledge.md
Created March 15, 2025 14:52
Lovable + Supabase knowledge to avoid common errors

Supabase onAuthStateChange considerations

Whenever you need to add some logic under supabase.auth.onAuthStateChange, make sure to consider Supabase docs regarding this: https://supabase.com/docs/reference/javascript/auth-onauthstatechange

Specially the warning about not using an async function as its callback:

Important: A callback can be an async function and it runs synchronously during the processing of the changes causing the event. You can easily create a dead-lock by using await on a call to another method of the Supabase library.

  • Avoid using async functions as callbacks.
  • Limit the number of await calls in async callbacks.
  • Do not use other Supabase functions in the callback function. If you must, dispatch the functions once the callback has finished executing. Use this as a quick way to achieve this:
@douglasmiranda
douglasmiranda / pdf-to-svg.md
Last active March 17, 2025 03:10
About PDF to SVG converters

Update in 2024

In 2024 I'm actually having a good time using mupdf.

About my experience with mupdf:

It's written in C, but you can use it in many ways. Command line, python lib (pymupdf), js, and others.

I still coundn't find issues that I had with other tools and weird broken PDFs, so I'd say pretty good.

@lucasKoyama
lucasKoyama / cheatsheet.md
Last active March 17, 2025 03:10
Next.js 14 CheatSheet

Would it be possible to include an iCal file attachment to the Access-A-Ride advance notification emails with a 30 minute window from the specified pickup time (that is the window in which Access-A-Ride drivers need to arrive)?

For example: if my Access-A-Ride is supposed to pick me up at 10:34 am from 1000 Broadway Ave and then again at 8:00 pm from 900 Jay St., include a calendar event (a .ics file) that would look similar to the following, attached to the advance trip notification:

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
SUMMARY:Access-A-Ride Pickup
@gladiatx0r
gladiatx0r / Workstation-Takeover.md
Last active March 17, 2025 03:05
From RPC to RCE - Workstation Takeover via RBCD and MS-RPChoose-Your-Own-Adventure

Overview

In the default configuration of Active Directory, it is possible to remotely take over Workstations (Windows 7/10/11) and possibly servers (if Desktop Experience is installed) when their WebClient service is running. This is accomplished in short by;

  • Triggering machine authentication over HTTP via either MS-RPRN or MS-EFSRPC (as demonstrated by @tifkin_). This requires a set of credentials for the RPC call.
  • Relaying that machine authentication to LDAPS for configuring RBCD
  • RBCD takeover

The caveat to this is that the WebClient service does not automatically start at boot. However, if the WebClient service has been triggered to start on a workstation (for example, via some SharePoint interactions), you can remotely take over that system. In addition, there are several ways to coerce the WebClient service to start remotely which I cover in a section below.

@yorkxin
yorkxin / rfc6749.md
Last active March 17, 2025 03:03
RFC 6749 in Markdown - Edited from http://tools.ietf.org/rfc/rfc6749.txt
Internet Engineering Task Force (IETF)                     D. Hardt, Ed.
Request for Comments: 6749                                     Microsoft
Obsoletes: 5849                                             October 2012
Category: Standards Track
ISSN: 2070-1721

The OAuth 2.0 Authorization Framework

Abstract

@jcmvbkbc
jcmvbkbc / gist:316e6da728021c8ff670a24e674a35e6
Last active March 17, 2025 03:02
esp32s3 linux rebuild scripts
Latest versions of these scripts are available in git repository https://github.com/jcmvbkbc/esp32-linux-build
[TASK(s)]
1.
[INPUT]
Design a chatbot interface where, instead of responding with plain text, the AI provides action buttons based on the user’s message. The chatbot should analyze the user input and dynamically generate relevant options as clickable buttons.
Key Features:
@bearlike
bearlike / clear_systemd_journal_logs.md
Created March 8, 2022 07:59
Clear Systemd Journal Logs in Ubuntu 20.04

Clear Systemd Journal Logs in Ubuntu 20.04

Systemd has its own logging system called the journal, and the log files are stored in /var/log/journal.

Check current disk usage of journal files

sudo journalctl --disk-usage

Rotate journal files

  • Active journal files will be marked as archived, so that they are never written to in future.