Skip to content

Instantly share code, notes, and snippets.

@HereOrCode
HereOrCode / wa-decrypt.js
Created February 19, 2025 10:49 — forked from Gimenz/wa-decrypt.js
a function to decrypt WA Media
/**
* this code is copied from https://github.com/open-wa/wa-decrypt-nodejs
* i just made it more simplified
*/
const { default: axios } = require('axios');
const crypto = require('crypto');
const hkdf = require('futoin-hkdf');
const atob = require('atob');
var saveBlob = (function () {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
return function (blob, fileName) {
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
@HereOrCode
HereOrCode / fetchStream.js
Created January 17, 2024 00:56 — forked from blackbing/fetchStream.js
Server Sent Event with fetch stream
const url = 'https://api.example.com/v1/sse';
const accessToken = 'test';
fetch(url, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})
.then(response => {
if (response.ok && response.body) {
reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
@HereOrCode
HereOrCode / jerry.swift
Created June 4, 2023 07:14 — forked from vorce/jerry.swift
Mouse move and click test thing for macos in swift
import Cocoa
import Foundation
// Move around and click automatically at random places in macos, kinda human like in a cheap way.
// Moves the mouse pointer to `moves` random locations on the screen and runs the `action` function at
// each point with the point as argument.
func mouseMoveWithAction(moves: Int, action: (CGPoint) -> Void = defaultAction) {
let screenSize = NSScreen.main?.visibleFrame.size