Skip to content

Instantly share code, notes, and snippets.

View ishowta's full-sized avatar
😛

iwatachan ishowta

😛
View GitHub Profile
@ishowta
ishowta / index.ts
Last active April 26, 2024 05:29
Thin wrapper for firebase-admin firestore compatibility with firebase-js-sdk (experimental)
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@ishowta
ishowta / move_github_project_issues.ts
Created April 14, 2022 19:23
Move all issues in a project to another project
import "dotenv/config";
import { request, gql } from "graphql-request";
import axios from "axios";
const GITHUB_TOKEN = `xxx`;
const ORG_NAME = `abc`;
const DST_PROJECT_NUMBER = 1;
const SRC_PROJECT_NUMBER = 2;
const greq = async (q: string) => {
@ishowta
ishowta / preventTranslateCodes.js
Last active December 28, 2021 00:19
prevent translate code
allPre = document.querySelectorAll('pre')
allPre.forEach(pre => {
code = document.createElement('code')
code.appendChild(pre.cloneNode(true))
code.style.all = 'unset'
pre.parentNode.insertBefore(code, pre)
pre.remove()
})
"config": {
"detectGlobalManagerConfig": false,
"detectHostRulesFromEnv": false,
"postUpgradeTasks": {
"commands": [],
"fileFilters": [],
"executionMode": "update"
},
"onboardingBranch": "renovate/configure",
"onboardingCommitMessage": null,
@ishowta
ishowta / dead_check.bat
Last active October 22, 2020 19:29
[WIP] Monitor iphone & quest battery dead
@echo off
set errmes=ARP エントリが見つかりませんでした。
set iphone=192.168.11.3
set quest=192.168.11.12
arp -d %iphone%
ping %iphone% -n 1 -w 10000
arp -a %iphone% > tmpfile
@ishowta
ishowta / apex.py
Last active February 26, 2020 23:29
play media and hide game between Apex matching time
from scapy.all import *
from sys import exit
import sys
from ctypes import *
import win32gui, win32com.client
from enum import Enum
user32 = windll.user32
kernel32 = windll.kernel32
# definition
@ishowta
ishowta / stringExtension.swift
Last active July 22, 2019 14:24
Swift string random access extension (fuckin' slow)
// Too bad extension. Bad I think it is the best way.
extension String {
subscript(index: Int) -> Character {
return self[self.index(self.startIndex, offsetBy: index)]
}
subscript(bounds: CountableRange<Int>) -> Substring {
return self[index(at: bounds.lowerBound)..<index(at: bounds.upperBound)]
}
@ishowta
ishowta / RemoveRating.js
Last active February 25, 2020 11:39
Remove any rating display from Web
function run(nodes){
nodes.forEach(function(node){
if(typeof node.querySelectorAll !== "function") return;
document.querySelectorAll("*[class*=star]").forEach(function(e){e.remove()})
document.querySelectorAll("*[class*=rating]").forEach(function(e){e.remove()})
})
}
run([document])
@ishowta
ishowta / RemoveImageFromSoundcloud.js
Created July 2, 2019 16:09
Remove Artwork & Header From Soundcloud
function run(nodes){
nodes.forEach(function(node){
if(typeof node.querySelectorAll !== "function") return;
// Remove artwork
node.querySelectorAll("span.sc-artwork").forEach(function(e){e.remove()})
// Remove header
node.querySelectorAll("div.profileHeaderBackground__visual").forEach(function(e){e.remove()})
})
}
@ishowta
ishowta / CodeWrapperSample.nim
Last active February 25, 2020 11:43
DI by macro
import macros, sugar, sequtils
import rationals
proc `//`[T: SomeInteger](num, den: T): Rational[T] = initRational(num, den)
proc `//`[T: not SomeInteger](num, den: T): auto = num / den
proc genReplacer(fromNode, toNode: NimNode): auto =
proc replacer(node: NimNode):NimNode =
if node.len == 0:
if node.kind == nnkIdent and node == fromNode: