Skip to content

Instantly share code, notes, and snippets.

@antonbabenko
antonbabenko / amz_content_sha256.js
Created November 19, 2024 16:11
Lambda@Edge (origin-request) for CloudFront OAC with Lambda Function URL integration for POST/PUT
'use strict';
const crypto = require('crypto');
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
const headers = request.headers;
const method = request.method;
const body = Buffer.from(request.body.data, 'base64').toString();
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active January 19, 2025 05:47
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

import kotlinx.cinterop.memScoped
import kotlinx.cinterop.allocArrayOf
import kotlinx.cinterop.addressOf
import kotlinx.cinterop.usePinned
import platform.Foundation.NSData
import platform.Foundation.create
import platform.posix.memcpy
public fun ByteArray.toData(): NSData = memScoped {
NSData.create(bytes = allocArrayOf(this@toData),

Preact + Material-UI example

Preact is a fast 3kB alternative to React with the same modern API.

This example uses shows how to use Material UI 4 with Preact X and Preact CLI 3.

How to use

git clone blah preact-mui
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active January 19, 2025 05:42
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@Knoph1
Knoph1 / Knoph's FreeCampCode.hmtl
Last active January 19, 2025 05:37
Knoph's FreeCampCode
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<section>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
</section>
@luigiMinardi
luigiMinardi / tex-colors.md
Last active January 19, 2025 05:36
Github markdown colors (Using Tex and the github MathJax support)

Small warning for everyone that are thinking if using Tex colors is a good idea or not

  • 2023-05-02 - Since a few days ago \colorbox and \fcolorbox are broken and Github did't talk about if it's a temporary thing or if it will not be added back.
    • 2024-01-04 - Since it has not being added back I deduce that it will never be so I removed all mentions to it on the rest of the gist.
  • 2023-09-29 - Tex seems to not work on h1 to h6 anymore (markdown #'s)
    • 2024-01-04 - Now it works again, I'll keep the message for a while to remember that it may change again in the future

As you can se with the above message(s) Tex may not be very stable and may not be an option to you as of the dates expressed above. You can also check other tex problems here.

Github released Tex support and colors* to the markdown and you din't realized

@ripatel-fd
ripatel-fd / snapshots.md
Last active January 19, 2025 05:26
Informal Guide to Solana Snapshots

Consider this an informal guide to reading the Solana snapshot format. This guide is written for Solana Labs versions v1.14 through v1.17.

You are probably reading this because you want to read the accounts in a snapshot without going through the pain of interfacing with the Solana Labs codebase.

Terminology

We assume general familiarity with the Solana ledger.

@AshtakaOOf
AshtakaOOf / best.md
Last active January 19, 2025 05:23
Best Anime SD Models SDv1/SDXL

My current favorite SD models

Warning

To access the discord post links please join the TouhouAI (24k members) discord server.

WIP

@brenes
brenes / README.md
Last active January 19, 2025 05:21
CSV de paises, con nombre en castellano, ingles, codigo ISO y prefijo telefónico del país