Skip to content

Instantly share code, notes, and snippets.

@chiliec
chiliec / generate.ts
Created April 19, 2024 08:19
Stable Diffusion 3.0 (SD3) image-to-image code example
import FormData from "form-data";
import fs from "node:fs";
import axios from "axios";
export async function generate(
originalImagePath: string,
resultImageName: string,
prompt: string,
negativePrompt: string,
strength: number,
@unitycoder
unitycoder / RayMarchingSpheres.cs
Last active April 19, 2024 08:17
Unity Ray Marching with Sphere Tracing
// unity ray marching with sphere marching : https://unitycoder.com/blog/2019/05/06/ray-marching/
// based on Ray Marching tutorial from The Coding Train https://www.youtube.com/watch?v=-6iIc6-Y-kk
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RayMarchingSpheres : MonoBehaviour
{
// place spheres under this root gameobject
@rxaviers
rxaviers / gist:7360908
Last active April 19, 2024 08:16
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 19, 2024 08:10
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@mdonkers
mdonkers / server.py
Last active April 19, 2024 08:10
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@hungneox
hungneox / WIN10.MD
Last active April 19, 2024 08:07
How Make a Windows 10 USB Using Your Mac - Build a Bootable ISO From Your Mac's Terminal

Most new PCs don't come with DVD drives anymore. So it can be a pain to install Windows on a new computer.

Luckily, Microsoft makes a tool that you can use to install Windows from a USB storage drive (or "thumbdrive" as they are often called).

But what if you don't have a second PC for setting up that USB storage drive in the first place?

In this tutorial we'll show you how you can set this up from a Mac.

Step 1: Download the Windows 10 ISO file

You can download the ISO file straight from Windows. That's right - everything we're going to do here is 100% legal and sanctioned by Microsoft.

@nathzi1505
nathzi1505 / opencv-fonts.py
Created June 29, 2020 06:21
Custom OpenCV font
import cv2
import numpy as np
img = np.zeros((100, 300, 3), dtype=np.uint8)
ft = cv2.freetype.createFreeType2()
ft.loadFontData(fontFileName='Ubuntu-R.ttf',
id=0)
ft.putText(img=img,
text='Quick Fox',
@lincolnthalles
lincolnthalles / random_memo.js
Last active April 19, 2024 08:06
Add "Random Memo" button to Memos v0.21+ sidebar
const RANDOM_MEMO_SETTINGS = {
// Amount of memos to cache
memoAmount: 100,
// Kinds of memos to cache: PUBLIC = visible to everyone, PROTECTED = logged in users, PRIVATE = only the creator
memoKinds: ["PUBLIC", "PROTECTED", "PRIVATE"],
// Time in minutes to cache the memos
memoCacheTimeMinutes: 60,
// Username of the memo creator to filter the memos
memoCreatorUsername: "",
// Button text
@mattmcd
mattmcd / Hello.g4
Last active April 19, 2024 08:04
Simple ANTLR4 grammar example
// define a grammar called Hello
grammar Hello;
r : 'hello' ID;
ID : [a-z]+ ;
WS : [ \t\r\n]+ -> skip ;
var myElement = document.getElementById('IDoftheDIV');
if(window.addEventListener) {
// Normal browsers
myElement.addEventListener('DOMSubtreeModified', contentChanged, false);
} else
if(window.attachEvent) {
// IE
myElement.attachEvent('DOMSubtreeModified', contentChanged);
}