Skip to content

Instantly share code, notes, and snippets.

@skoqaq
skoqaq / build4123.sublime4.key
Last active May 7, 2024 17:22
Sublime Text 4 License Key
—– BEGIN LICENSE —–
Mifeng User
Single User License
EA7E-1184812
C0DAA9CD 6BE825B5 FF935692 1750523A
EDF59D3F A3BD6C96 F8D33866 3F1CCCEA
1C25BE4D 25B1C4CC 5110C20E 5246CC42
D232C83B C99CCC42 0E32890C B6CBF018
B1D4C178 2F9DDB16 ABAA74E5 95304BEF
9D0CCFA9 8AF8F8E2 1E0A955E 4771A576
@kalomaze
kalomaze / llm_samplers_explained.md
Last active May 7, 2024 17:22
LLM Samplers Explained

LLM Samplers Explained

Everytime a large language model makes predictions, all of the thousands of tokens in the vocabulary are assigned some degree of probability, from almost 0%, to almost 100%. There are different ways you can decide to choose from those predictions. This process is known as "sampling", and there are various strategies you can use which I will cover here.

OpenAI Samplers

Temperature

  • Temperature is a way to control the overall confidence of the model's scores (the logits). What this means is that, if you use a lower value than 1.0, the relative distance between the tokens will become larger (more deterministic), and if you use a larger value than 1.0, the relative distance between the tokens becomes smaller (less deterministic).
  • 1.0 Temperature is the original distribution that the model was trained to optimize for, since the scores remain the same.
  • Graph demonstration with voiceover: https://files.catbox.moe/6ht56x.mp4
@siwalikm
siwalikm / aes-256-cbc.js
Last active May 7, 2024 17:22
AES-256-CBC implementation in nodeJS with built-in Crypto library
'use strict';
const crypto = require('crypto');
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key
const IV = "5183666c72eec9e4"; // set random initialisation vector
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex');
const phrase = "who let the dogs out";
var encrypt = ((val) => {
@davepcallan
davepcallan / AddColumnIfNotExists.sql
Created May 7, 2024 16:20
Add created_date column to all tables which don't have it already in SQL Server
SELECT 'ALTER TABLE ' + QUOTENAME(ss.name) + '.' + QUOTENAME(st.name) + ' ADD created_date DATETIME NULL;'
FROM sys.tables st
INNER JOIN sys.schemas ss on st.[schema_id] = ss.[schema_id]
WHERE st.is_ms_shipped = 0
AND NOT EXISTS (
SELECT 1
FROM sys.columns sc
WHERE sc.[object_id] = st.[object_id]
AND sc.name = 'created_date'
)
@zachdaniel
zachdaniel / stream_distribute.ex
Last active May 7, 2024 17:20
A small demo to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`. Open in Livebook: https://livebook.dev/run?url=https%3A%2F%2Fgist.github.com%2Fzachdaniel%2Fd5ab06a9d2362fceeb6d27c37b206e28
<!-- livebook:{"persist_outputs":true} -->
# Distribute
## Section
A small toy to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`.
```elixir
defmodule Distribute do
@maxpain
maxpain / interfaces.yaml.j2
Last active May 7, 2024 17:13
Talos Ansible Role
- interface: {{ 'bond0' if hostvars[item].bond_interfaces | length > 0 else 'eth0' }}
dhcp: false
addresses:
- {{ hostvars[item].ip }}
routes:
- network: 0.0.0.0/0
gateway: {{ hostvars[item].ip | ipaddr('1') | ipaddr('address') }}
{% if hostvars[item].bond_interfaces | length > 0 %}
bond:
interfaces: {{ hostvars[item].bond_interfaces }}
@lats
lats / claim_all_the_things.js
Last active May 7, 2024 17:13
Tampermonkey script to claim all of the items within a Bundle on Itch.io
// ==UserScript==
// @name Activate all Itch.io Bundle downloads
// @version 1
// @include https://itch.io/bundle/download/*
// @include https://*.itch.io/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @grant none
// ==/UserScript==
$(document).ready(function() {
@usagimaru
usagimaru / HiddenMacOSDebuggingPanel.md
Last active May 7, 2024 17:12
Enables useful debugging panel in macOS apps

Use _NS_4445425547 or NS🐞 for enables debuggging panel. When enabled it, a ladybug 🐞 menu appears in the app menu bar.

“4445425547” means DEBUG in Unicode table.

0x44=D
0x45=E
0x42=B
0x55=U
0x47=G

@nir9
nir9 / server.c
Created November 25, 2023 16:50
Minimalist C Web Server - not for production use, only for fun :)
#include <sys/socket.h>
#include <string.h>
#include <fcntl.h>
#include <sys/sendfile.h>
#include <unistd.h>
#include <netinet/in.h>
void main() {
int s = socket(AF_INET, SOCK_STREAM, 0);
struct sockaddr_in addr = {