Important
Run with deno run --allow-run=deno main.ts
(this allows us to run deno
instead of node
in scripts, but prevents any other nefarious scripts)
npm run start
> [email protected] start
> node evil.js
#![allow(unused)] | |
use std::collections::{ HashMap, HashSet }; | |
#[derive(Debug)] | |
enum Op { | |
AND, | |
XOR, | |
OR | |
} |
#![allow(unused)] | |
use std::collections::{ HashMap, HashSet }; | |
fn main() { | |
let networks = "kh-tc | |
qp-kh | |
de-cg | |
ka-co | |
yn-aq |
Important
Run with deno run --allow-run=deno main.ts
(this allows us to run deno
instead of node
in scripts, but prevents any other nefarious scripts)
npm run start
> [email protected] start
> node evil.js
fn main() { | |
let s = "125 17"; | |
let mut data: Vec<_> = s.split(" ").map(|x| { x.parse::<usize>().unwrap() }).collect(); | |
let mut len = data.len(); | |
// println!("{:?}", data); | |
for _ in (0..).take(75) { | |
// println!("len: {len}"); |
#![allow(unused)] | |
fn main() { | |
let example = " | |
MMMSXXMASM | |
MSAMXMSMSA | |
AMXSXMAAMM | |
MSAMASMSMX | |
XMASAMXAMM | |
XXAMMXXAMA |
const readline = require("node:readline"); | |
const { Writable } = require("node:stream"); | |
const getPassword = (user) => | |
new Promise((resolve) => { | |
const mutableStdout = new Writable({ | |
write: function (chunk, encoding, callback) { | |
if (!this.muted) process.stdout.write(chunk, encoding); | |
callback(); | |
}, |
const crypto = require("node:crypto"); | |
const { Buffer } = require("node:buffer"); | |
const ALGO = "aes-256-cbc"; | |
// random SECRET stored in memory | |
const SECRET = crypto.randomBytes(64); | |
function getKey(salt) { | |
// In 2023, OWASP recommended to use 600,000 iterations for PBKDF2-HMAC-SHA256 and 210,000 for PBKDF2-HMAC-SHA512.[6] | |
return crypto.pbkdf2Sync(SECRET, salt, 210_000, 32, "sha512"); |
// to find the fuel required for a module, take its mass, divide by three, round down, and subtract 2. | |
use std::fs; | |
use std::io::Error; | |
fn main() -> Result<(), Error> { | |
let contents = fs::read_to_string("./src/input.txt"); | |
let data = match contents { | |
Ok(c) => c, |
import { useRef, useEffect } from 'react'; | |
type IProps = Record<string, unknown>; | |
const useWhyDidYouUpdate = (componentName: any, props: any) => { | |
const oldPropsRef = useRef<IProps>({}); | |
useEffect(() => { | |
if (oldPropsRef.current) { | |
// iterate through all the key of the old and new props |