Skip to content

Instantly share code, notes, and snippets.

View og24715's full-sized avatar
😑
Reconstructing the fragments of chaos.

Hirakawa og24715

😑
Reconstructing the fragments of chaos.
  • Shizuoka, Japan
View GitHub Profile
@og24715
og24715 / bokenesuElon.js
Created July 25, 2023 13:53
Twitter のファビコンを鳥に戻すやつ
// ==UserScript==
// @name Fuck Elon
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author og24715
// @match https://twitter.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant none
// ==/UserScript==
interface Endpoint<Parameter, Response> {
parameter: Parameter,
response: Response,
}
/**
* @link https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgKIgCYAcD2owA8ACnFHALYSRQA0yAShAM64hMQB8yA3gLABQyIciykKVaAC5kJMpWo0Bw5FGat20xixxsIi-gF8BAjBAQAbUigtwmTZAEEiASQDC54BHAF02POHsIAA9ITHtuZABtBBxycjhMaSYwKFAAcwBdaV9cfAIAVxAAaxAcAHcQOkKS8pAuAy4+QREcZIIAFWRg0Ix7VBCyBEIiiABPHBg0TFyAumTUkDSODgAKGLiEjGl2uhwsMGAdAH5s6f8wJkj2jMiAclE5CShbjIBKU798S+u71W1dF7IARGfgCGJsMDIOBYYDIAC8yBAEDKjhc7k83iaynYmAA+ggABZwMAfGaEebpOgAIxwOHMEASHH0yjSVFx+SwGGJEFJ5wIEUQMUKYFxwC2iPy5Cp0GQBjoERpOCK8SgRWk1VKFUiGVlHGBq1exn40OAADpcMkVrccRh8USwLdXgBuME6ZI8ZCK5WkIqy+FQmHm1pgK2skUcrmQW7yqEIIXgUXigCMssNxsDFpDt1M9MgduJjpd-CAA
**/
declare class APIClient<Endpoints extends { [command: string]: Endpoint<unknown, unknown> }> {
post<T extends Extract<keyof Endpoints, string>>(command: T, option?: Endpoints[T]['parameter']): Endpoints[T]['response']
@og24715
og24715 / antiprotector.js
Created January 20, 2023 18:11
メロブでスクショできるやつ
// ==UserScript==
// @name Anti protector
// @namespace https://twitter.com/og24715
// @version 0.1
// @description try to take over the world!
// @author og24715
// @match https://www.melonbooks.co.jp/viewer/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=melonbooks.co.jp
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Return Product Page After Login
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author og24715
// @match https://www.melonbooks.co.jp/mypage/
// @icon https://www.google.com/s2/favicons?sz=64&domain=melonbooks.co.jp
// @grant none
// ==/UserScript==
@og24715
og24715 / front-wheel.md
Last active December 12, 2022 06:55
3LN3 Repair parts
@og24715
og24715 / Counter.spec.ts
Last active May 23, 2022 07:15
Interaction testing in Storybook play function and, reuse to assert in Jest
import { composeStories } from '@storybook/testing-react';
import { render } from '@testing-library/react';
import * as stories from './Counter.stories';
const { ClickOnce, ClickTwice } = composeStories(stories);
test('Click once', () => {
const { container, getByRole } = render(<ClickOnce />);
ClickOnce.play({ canvasElement: container });
@og24715
og24715 / pasteMeOnAddressBar.js
Created September 17, 2019 06:36
Check the total amount shopped at Steam.
alert([...document.querySelectorAll("#main_content > table > tbody > tr > td:nth-child(2)")].filter(element => element.innerText.includes('Dead by Daylight')).map(element => element.parentElement.querySelector('.wht_total').innerText.replace('¥ ', '').replace(',', '')).reduce((a, b) => Number(a) + Number(b)))
module.exports = {
"extends": "airbnb",
"plugins": [
"babel"
],
"parser": "babel-eslint",
"rules": {
"no-underscore-dangle": [
2, {
"allowAfterThis": true
@og24715
og24715 / prepare-commit-msg
Last active June 19, 2019 07:40
チケット名をコミットメッセージにプレフィックスするやつ
#!/usr/bin/env node
const { exec } = require('child_process');
const fs = require('fs');
exec("git branch | grep '^\* '", (err, stdout, stderr) => {
const branchName = stdout.replace(/\n$/g, '');
const ticketName = branchName.split('/')[1];
const commitEditMessage = process.argv[2];
const commitMessage = fs.readFileSync(commitEditMessage);