Skip to content

Instantly share code, notes, and snippets.

@Yuyz0112
Yuyz0112 / hooks.js
Created January 17, 2019 09:53
rrweb + cypress
const sessionId = Cypress.env('sessionId');
const appFrame = window.parent.document.querySelectorAll('iframe')[0];
Cypress.on('window:load', () => {
appFrame.contentWindow.eval(`
const request = new XMLHttpRequest();
request.open('GET', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/rrweb.min.js', false);
request.send('');
const script = document.createElement('script');
script.type = 'text/javascript';
@Yuyz0112
Yuyz0112 / machine.js
Last active March 7, 2020 07:14
Generated by XState Viz: https://xstate.js.org/viz
function lastOf(arr) {
return arr[arr.length - 1];
}
function getCurrentStatement(ast) {
if (ast.body.length === 0) {
throw new Error("No statement found");
}
return lastOf(ast.body);
}
function getCurrentFrom(ast) {
// ==UserScript==
// @name i18n editor
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include /?i18n-editor/
// @grant none
// @require https://cdn.jsdelivr.net/npm/[email protected]/dist/jszip.min.js
// @require https://raw.githubusercontent.com/eligrey/FileSaver.js/master/dist/FileSaver.js
apiVersion: v1
kind: Endpoints
metadata:
name: cloudtower-perf
namespace: prometheus
subsets:
- addresses:
- ip: 1.2.3.5
nodeName: tower.smartx.com
- ip: 1.2.3.6
@Yuyz0112
Yuyz0112 / i
Created February 22, 2025 13:56
test-i
1
import { Easing, Series, staticFile } from "remotion";
import {
AbsoluteFill,
interpolate,
Sequence,
useCurrentFrame,
Img,
Audio,
} from "remotion";
import { z } from "zod";