Skip to content

Instantly share code, notes, and snippets.

View Cerberus's full-sized avatar

Cerberus Cerberus

View GitHub Profile
@Cerberus
Cerberus / out-5.txt
Last active May 3, 2023 05:34
[Answer] LMWN Mysterious code 3 (Directions: D: Down, U: Up, L: Left, R: Right)
DRDDDRRDDRRRRDDRDRRDDDRRDDDDRRRRDDRRRRRDDDDDLDDDRDRDRRRRRDRDRRRRDRRDDDDDRRRDDRRDRRRDRRDRRDRRRRRRURRRRRDRDRRRRRRRRRDRRRRRRRRRDRRDRRDRRRDRRRRURRRDDDRRRDRRRRRDDDRRDDRDRDRRRRRRDDDRDRDRDDRRRRRRDRDDRRRDDDRDDDDDRRDRDRDDDRDRRRRURRRRRRDRDRRDDRRRDRRRRRDRDRDDDRRRRRRRDDDDRDDDDDDRRDRDRRRRRRRRRDDDDDDDDDDLDDRRRRDRDRDRDDRRRRDDDDDDRDRDRRRDDRDRRDDRDRRRRRRRDRDDDDRRDDDDDRRRRRRRRDDDRRRRRDDDDRRRDRRRRDDDDRDDDDDDDRDDDDRRDRRDRRDDRRDDRRDDRDDRDDDRDRDDRDDDRDDRRRRRRDDDRRDDDRRDDRDDRRRRRRRDDRRDDRDDDRRRDRRRRRRRRURRRRDRDRRRRDRDDRRRURRDDDDRDDRRURRRRRRDDDRRDDDDDDRDDRDRRDDDDDDRRRRRRRRRRRDDRRRDRRRDRRRDDRDRRDRDDRDRRDRRRRRRRRRRURRURRRRRRRRRRDRRRRRDDRDRRRDDDDRDDDRRDDDDDDDRDDDDDRDDRDDDRDDDDDRDRRDDRRURRDRDRDRDRRRDDRDRRRRRRRRDDDRRDRRRDRRRRDDRRRDRDRRRDRRRRDDDDDDLDDRDRDDRRDRRDDDDRRRRRDDRRDDDDDRRRDRDRDRRRRRRRRDRRRRDDRRRDDDDRRRRDDDRDRRDDDDDDDLDDDDDDRDDDDLDDRDRRDRDDDRRRDDDDRRDRDRDDRRRRRDRDDRDRRDDDDDRRDDDDDDDDRRRRRRRRRDDRRRDDRRRRRRDDDDDRDDRDDDDDRDRRDDDDDDDDRDDDDRRRRDRRDRRDRRRDRDRDRRRDDRRRDDDDDDRRDDDDDDDRDRDDDDDDRDDRDDDRDDDRDRRRRDDDDDDDDDDDRRRRDDDDRRDDDDDDDR
@Cerberus
Cerberus / in-5.txt
Created May 3, 2023 05:31
LMWN Mysterious code 3
This file has been truncated, but you can view the full file.
123 895 208 824 400 812 935 93200 480 531 998 601 891 952 700 137 494 466 446 585 477 943 659 84800 685 395 272 399 82 31 549 612 403 634 94 736 953 194 22500 10900 187 996 87700 890 54700 735 929 916 81000 540 626 409 570 889 728 657 899 402 386 18 291 566 439 971 50 509 89500 948 891 998 467 124 556 248 952 206 86300 952 587 25900 274 26500 330 663 738 506 691 173 10200 863 531 159 629 33200 219 65800 98 981 728 731 333 287 69800 60100 608 533 583 95400 627 201 878 32700 558 771 109 569 249 778 44700 258 704 672 287 298 95 288 635 218 599 878 655 794 39500 569 93700 155 826 34500 36000 306 56400 524 604 976 190 231 234 763 219 483 96200 3700 906 854 438 36900 993 788 35 628 928 596 21100 111 35 207 862 74500 706 950 179 617 97500 99100 396 582 353 198 42 589 7000 427 467 324 146 523 57400 402 28 445 753 177 182 43 601 8 64000 33400 963 734 905 139 588 958 325 385 157 651 61 77 883 395 828 417 644 11300 92 650 693 947 315 476 92800 52 534 806 507 910 799 66000 632 119 545 71400 892 432 467 454 869 896 82300
@Cerberus
Cerberus / ct-open-by-jsx.tsx
Created May 27, 2022 05:23
Component Testing (+ React 18) Mount via JSX
import ReactDOM from 'react-dom/client'
import { mount } from '@cypress/react'
import { ReactNode } from 'react'
export const open = (jsx: ReactNode) => {
let myRoot: ReactDOM.Root
mount(<div />, {
ReactDom: {
@Cerberus
Cerberus / ct-open-by-url.tsx
Last active May 27, 2022 05:24
Component Testing (+ React 18) Mount via URL
import ReactDOM from 'react-dom/client'
import { MemoryRouter } from 'react-router-dom'
import { mount } from '@cypress/react'
import Application from '../Application' // NOTE: Your main component
export const open = (path: string) => {
let myRoot: ReactDOM.Root
mount(<div />, {
@Cerberus
Cerberus / wombo-combo.ts
Created May 26, 2022 06:35
Use Component Testing (cypress) with CRACO + ESBuild loader
// craco.config.js
const CracoEsbuildPlugin = require('craco-esbuild')
const { ProvidePlugin } = require('webpack')
module.exports = {
webpack: {
plugins: {
add: [new ProvidePlugin({ React: 'react' })],
},
},
@Cerberus
Cerberus / style.ts
Last active December 31, 2023 00:58
Simple way to apply dark mode (CSS)
// cypress/support/style.ts
export {}
const css = /* css */ `
:root {
--background: #222426;
--dark-background: #171717;
--lighter-background: #3a3a3a;
--light-element: #444648;
--active-button: #292c2e;
--active-color: #cccccc;
@Cerberus
Cerberus / persistedLink.ts
Last active February 2, 2022 07:40
A simple way to generate query-hash for `apollo client:extract`
const link = ApolloLink.split(
hasSubscriptionOperation,
new WebSocketLink({
uri:
'wss://hostname/__path__',
options: { reconnect: true },
}),
new Link({
uri: 'https://hostname/__path__',
}),
const hasSubscriptionOperation = ({ query: { definitions } }) =>
definitions.some(
({ kind, operation }) =>
kind === 'OperationDefinition' && operation === 'subscription',
)
const link = ApolloLink.split(
hasSubscriptionOperation,
new WebSocketLink({
@Cerberus
Cerberus / hasSubscriptionOperation.js
Created September 24, 2017 18:12
hasSubscriptionOperation function
const hasSubscriptionOperation = ({ query: { definitions } }) =>
definitions.some(
({ kind, operation }) =>
kind === 'OperationDefinition' && operation === 'subscription',
)