Skip to content

Instantly share code, notes, and snippets.

const modifier = async () => {
const sleep = msec => new Promise(resolve => {
if (document.readyState === 'complete') {
setTimeout(resolve, msec);
} else {
document.addEventListener('readystatechange', () => {
if (document.readyState === 'complete') {
setTimeout(resolve, msec);
}
}, { capture: false, passive: true });
@yuiAs
yuiAs / gbf_stop_mute.js
Created March 20, 2020 05:14
グラブルでフォーカス死ぬとMuteされるのを阻止
window.addEventListener('load', function() {
const names = [ 'blur' ];//[ 'blur', 'pagehide', 'unload', 'beforeunload' ];
for (const v of names) {
window.addEventListener(v, function(event) { // ignored this warning
if (window.Game.setting.sound_flag != 0) {
event.stopImmediatePropagation();
}
}, true)
}
})
@yuiAs
yuiAs / VKatsuCrypto.cs
Created November 14, 2018 06:23
Vカツのセーブデータを相互にごにょごにょ。Key/IVは自分で調べてね。
using System;
using System.IO;
using System.Security.Cryptography;
namespace vkatsu {
public class VKCrypto
{
public static RijndaelManaged Rijndael { get; private set; }
public int MaxBufferSize { get; set; } = 4*1024;
@yuiAs
yuiAs / gist:8e5c768b81dd0f4b55c835964c2234b6
Created June 6, 2018 03:16
Mintty color scheme (WSL向け)
# https://blogs.msdn.microsoft.com/commandline/2017/08/02/updating-the-windows-console-colors/
# Redが死ぬほど見づらい,Blueもちょっと微妙なので変更
ForegroundColour = 208, 208, 208
BackgroundColour = 28, 28, 28
CursorColour = 255, 175, 0
IMECursorColour = 128, 224, 160
Black = 12, 12, 12
BoldBlack = 118, 118, 118
Red = 249, 38, 114 #197, 15, 31
BoldRed = 255, 89, 149 #231, 72, 86
@yuiAs
yuiAs / test.cpp
Last active December 27, 2016 07:58
WASAPI共有モードの覚え書き
#include <fstream>
#include <memory>
#include <string>
#include <tuple>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
@yuiAs
yuiAs / gbf.css
Last active May 27, 2016 14:25
border-image周りで表示がおかしいやつ直して?
*::before {
border-color: transparent;
}
.pop-usual::before, [class^=cnt-]::before, [class^=prt-]::before, [class^=lis-]::before, [id^=prt-]::before {
border-style: solid;
border-width: 0;
}
@yuiAs
yuiAs / expand_range.cc
Last active March 9, 2016 11:34
Expand number list with ranges
template <typename T>
std::deque<T> expand_ranges(const std::string& src, size_t limit)
{
std::deque<T> r;
// 現状の parseStringToでは結局分割した std::stringが必要なので先に splitでバラしておく
auto a = split(src, ',');
for (auto it = a.cbegin(); ((it != a.cend()) && (r.size() <= limit)); ++it) {
T v1;
if (parseStringTo<T>(v1, *it) == it->size()) {
#include <SDKDDKVer.h>
#include <Windows.h>
#include <wincodec.h>
#include <comdef.h>
#include <wrl.h>
HRESULT test()
{
HRESULT hr;
@yuiAs
yuiAs / background.js
Last active July 19, 2019 16:54
TweetDeck弄りたい
(function() {
chrome.runtime.onInstalled.addListener(function () {
var rule3 = {
priority: 110,
conditions: [
new chrome.declarativeWebRequest.RequestMatcher({
url: {
hostEquals: 'pbs.twimg.com',
pathContains: '/media/',
queryContains: 'name='
@yuiAs
yuiAs / background.js
Last active November 22, 2015 04:34
艦これ用の何か
(function (_window) {
chrome.runtime.onConnect.addListener(function (port) {
if (port.name == "registerFilters") {
chrome.webRequest.onBeforeRequest.addListener(function (details) {
if (port && details.requestBody) {
port.postMessage({ url: details.url, data: details.requestBody.formData });
}
}, { urls: [ "http://*/kcsapi/api_req_hensei/change" ] }, [ "blocking", "requestBody" ]);
port.onDisconnect.addListener(function () {
// TODO: onBeforeRequest.removeListenerやっておいたほうが無駄に listener残らなくていいかも