Skip to content

Instantly share code, notes, and snippets.

Classes

@kopecmi8
kopecmi8 / cell0.js
Last active May 6, 2024 10:45
extended parameter handlling
function createProduct(price, productNumber, name, description) {
return {
price: price,
code: productNumber,
name: name,
desc: description
}
}
function discountCreateProduct(price, ...params) { ///tady se jedná o rest parameter
class="[a-zA-Z0-9:;\.\s\(\)\-\,]*"

Modules

@MichalBryxi
MichalBryxi / components.my-component\.js
Last active May 6, 2024 10:44
async-await-shenanigans
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
export default class extends Component {
@tracked foo = undefined;
@tracked bar = undefined;
@action
async clickMe() {
@akabe1
akabe1 / frida_multiple_unpinning.js
Last active May 6, 2024 10:44
Another Android ssl certificate pinning bypass for various methods
/* Android ssl certificate pinning bypass script for various methods
by Maurizio Siddu
Run with:
frida -U -f <APP_ID> -l frida_multiple_unpinning.js [--no-pause]
*/
setTimeout(function() {
Java.perform(function() {
console.log('');
@mayank99
mayank99 / $.js
Last active May 6, 2024 10:44
make your own `execa`-like shell with node built-ins
import { promisify } from 'node:util';
import { exec } from 'node:child_process';
const $ = async (strings, ...values) => {
try {
return (await promisify(exec)(String.raw({ raw: strings }, ...values))).stdout;
} catch {
return ''; // yolo
}
};
@mayank99
mayank99 / inline-workers.js
Last active May 6, 2024 10:44
Create a web worker in the same file where it's used
function createWorker(fn) {
const url = URL.createObjectURL(
new Blob([`\
onmessage = ({ data }) => {
const fn = ${fn.toString()};
const result = fn(...JSON.parse(data));
self.postMessage(result);
};
`])
);