Skip to content

Instantly share code, notes, and snippets.

@allanmac
allanmac / sort.cu
Last active January 19, 2025 02:53
Thrust Radix Sort benchmark
// -*- compile-command: "nvcc -D THRUST_SORT_TYPE=uint32_t -arch sm_50 -o sort sort_32.cu"; -*-
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/generate.h>
#include <thrust/sort.h>
#include <thrust/copy.h>
#include <algorithm>
#include <cstdlib>
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active January 19, 2025 02:50
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active January 19, 2025 02:42
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

@creachadair
creachadair / chrome-encrypted-cookies.md
Last active January 19, 2025 02:38
Encryption format for Chrome browser cookies

Google Chrome Encrypted Cookies

Google Chrome stores browser cookies in an SQLite database. The database has two tables, meta containing format and version metadata, and cookies with the contents of the cookies. The cookies table uses this schema:

-- To reproduce: sqlite path/to/Cookies .schema
CREATE TABLE cookies (
   creation_utc     INTEGER  NOT NULL,  -- microseconds since epoch
   host_key         TEXT     NOT NULL,  -- domain
   name             TEXT     NOT NULL,
@pkazmier
pkazmier / .skhdrc
Last active January 19, 2025 02:23
# Modified from https://github.com/alyssais configuration.
#
# The following configuration heavily leverages modal keymaps to minimize the
# pollution of global keybindings. In addition, the modal keymaps facilitate
# the consistent use of the same keybindings across different modes. For
# example, this configuration uses 'h', 'l', 'j', and 'k' to represent west,
# east, south, and north when: changing focus, warping windows, resizing
# windows, swapping windows, and moving floating windows. Those four keys are
# mapped differently depending on the current mode to provide a consistent user
# experience.
@evdokimovm
evdokimovm / index.js
Last active January 19, 2025 02:22
Save the whole list of your saved youtube playlists to text file. Open youtube.com/feed/library or youtube.com/feed/you press "show more" in playlists section. scroll page down to load all playlists list and run the following script in console
var all_contents = document.querySelectorAll('div#contents > ytd-item-section-renderer:nth-of-type(3) > div#contents > ytd-shelf-renderer > div#dismissible > div#contents > ytd-grid-renderer > div#items > ytd-grid-playlist-renderer > div#details > yt-formatted-string > a')
async function getFullTitle(item) {
var double_parent_node = item.parentNode.parentNode
var channel_name_container = double_parent_node.querySelector('ytd-video-meta-block > div#metadata > div#byline-container > ytd-channel-name > div#container > div#text-container > yt-formatted-string')
var playlist_title = double_parent_node.querySelector('h3 > a')
var _a = channel_name_container.querySelector('a')
if (_a) {
return playlist_title.title + ' | -> ' + _a.text + ' | -> ' + _a.href + '\n'
} else {
// parses a v3 PSG file
object PassiveTreeParser {
fun readData(inputStream: InputStream): SkillTreeGraph {
val data = DataTypeReader(inputStream, order = ByteOrder.LITTLE_ENDIAN).readPassiveTreeData()
val remainingBytes = inputStream.readAllBytes()
require(remainingBytes.isEmpty()) { "$remainingBytes bytes were not processed" }
return data
}
\documentclass{article}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\usepackage{etoolbox}
% Individual \itshape or \bfseries work without this.
% Combinations of both need the robustified version
@disler
disler / README_MINIMAL_PROMPT_CHAINABLE.md
Last active January 19, 2025 02:12
Minimal Prompt Chainables - Zero LLM Library Sequential Prompt Chaining & Prompt Fusion

Minimal Prompt Chainables

Sequential prompt chaining in one method with context and output back-referencing.

Files

  • main.py - start here - full example using MinimalChainable from chain.py to build a sequential prompt chain
  • chain.py - contains zero library minimal prompt chain class
  • chain_test.py - tests for chain.py, you can ignore this
  • requirements.py - python requirements

Setup