Skip to content

Instantly share code, notes, and snippets.

View shikhir-arora's full-sized avatar
💭
¯\_(ツ)_/¯

Shikhir Arora shikhir-arora

💭
¯\_(ツ)_/¯
View GitHub Profile
@tevador
tevador / readme.md
Last active October 2, 2025 21:31
Elliptic curve tower-cycle for Curve25519

Elliptic curve tower-cycle for Curve25519

Some advanced cryptographic protocols require a "curve cycle", which is a pair of elliptic curves Ep and Eq over prime fields GF(p) and GF(q) such that #Ep = q and #Eq = p, i.e. the scalar field of each curve exactly equals to the base field of the other curve.

Unfortunately, Curve25519 has a composite order (divisible by 8), so it cannot be part of a curve cycle (both p and q need to be primes).

However, if we could find a curve cycle with p = 2^255 - 19, points on Curve25519 could enter the cycle via curve Eq, which has an order of p. We call this arrangement a "tower-cycle":

 -- Ep --
@danirukun
danirukun / whisper-transcribe.bash
Last active September 2, 2025 08:37
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@Iliannnn
Iliannnn / Discord.js-v14-Events.md
Last active November 11, 2025 19:33
Discord.js v14 Events - Cheatsheet

Discord.js v14 Events

An overview of all events in Discord.js v14 with examples.

📢 | Last updated: 27 July 2022

ℹ️ | client references to your client instance.

ℹ️ | The v13 overview can be found here.

@Bonemind
Bonemind / f1signalr.js
Created July 25, 2022 10:47
F1 telemetry signalr websocket connection
// npm i axios signalr
const axios = require('axios');
const ws = require('ws');
async function negotiate() {
const hub = encodeURIComponent(JSON.stringify([{name:"Streaming"}]));
const url = `https://livetiming.formula1.com/signalr/negotiate?connectionData=${hub}&clientProtocol=1.5`
const resp = await axios.get(url);
return resp;
}
@LinusHenze
LinusHenze / iOS_16_Launch_Constraints.txt
Created June 15, 2022 16:30
Description of the Launch Constraints introduced in iOS 16
iOS 16 introduced launch constraints, which can be used to constraint the launch of an application.
There are three types of constraints:
Self Constraints, which the launched application itself must meet
Parent Constraints, which the parent process must meet
Responsible Constraints, which the "responsible process" must meet (I assume that the responsible process is the process that asked launchd to launch a service)
Additionally, the TrustCache format was updated (see below) to support assigning each binary a "Constraint Category", which forces Self and Parent Constraints.
Note that Self, Parent and Responsible Constraints can also be set by the process performing the launch and they can be included in the code signature, in the new blob type 0xFADE8181. In both cases, the constraints are DER encoded (just like the DER entitlements).
Constraint Categories (from TrustCache, new in version 2):
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title>Rebane's Discord Colored Text Generator</title>
<meta charset="UTF-8">
<meta name="description" content="Rebane's Discord Colored Text Generator">
<meta name="author" content="rebane2001">
<style>
/*
@martinwoodward
martinwoodward / mermaid.md
Created February 11, 2022 20:34
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
 iframe-&gt;&gt;dotcom: iframe ready
@jeb5
jeb5 / Youtube Subs to OPML.js
Last active July 22, 2025 13:06
Youtube Subscriptions to RSS/OPML
const channels = [...document.querySelectorAll("#main-link.channel-link")].map(e => {
const [, a, b] = e.href.match("/((?:user)|(?:channel))/(.*)$");
const feed = "https://www.youtube.com/feeds/videos.xml?" + (a === "user" ? "user=" : "channel_id=") + b;
const channelName = e.querySelector("yt-formatted-string.ytd-channel-name").innerText;
return [feed, channelName];
});
if (channels.length == 0) {
alert("Couldn't find any subscriptions");
} else {
console.log(channels.map(([feed, _]) => feed).join("\n"));
// ==UserScript==
// @name No YouTube Volume Normalization
// @namespace https://gist.github.com/abec2304
// @match https://www.youtube.com/*
// @match https://music.youtube.com/*
// @grant GM_addElement
// @version 2.74
// @author abec2304
// @description Enjoy YouTube videos at their true volume
// @run-at document-start
@mikhailov-work
mikhailov-work / turbo_colormap.glsl
Last active December 9, 2025 06:56
Turbo Colormap Polynomial Approximation in GLSL
// Copyright 2019 Google LLC.
// SPDX-License-Identifier: Apache-2.0
// Polynomial approximation in GLSL for the Turbo colormap
// Original LUT: https://gist.github.com/mikhailov-work/ee72ba4191942acecc03fe6da94fc73f
// Authors:
// Colormap Design: Anton Mikhailov ([email protected])
// GLSL Approximation: Ruofei Du ([email protected])