Skip to content

Instantly share code, notes, and snippets.

@ebith
ebith / skipPregameVideos.bat
Created Apr 4, 2018
The Elder Scrolls Online: No intro fix
View skipPregameVideos.bat
@powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 1})-join\"`n\");&$s" %*&goto:eof
$path = "$env:USERPROFILE\Documents\Elder Scrolls Online\live\UserSettings.txt"
(Get-Content $path) | foreach { $_ -creplace "SET SkipPregameVideos `"0`"", "SET SkipPregameVideos `"1`"" } | Set-Content $path
@ebith
ebith / injectUserCss.js
Last active May 24, 2021
Inject CSS into a Discord client.
View injectUserCss.js
/*
* Usage
*
* copy core.asar from Discord app
* Win: %APPDATA%/discord/0.0.xxx/modules/discord_desktop_core/core.asar
* Mac: ~/Library/Application\ Support/discord/0.0.xxx/modules/discord_desktop_core/core.asar
* yarn add asar
* asar e core.asar core
* CSS_PATH=C:/dropbox/discordUser.css node injectUserCss.js
* asar p core core.asar
@ebith
ebith / Communication.c
Created Jan 13, 2018
Serial communication, USART, LUFA Library, AVR
View Communication.c
#include <stdio.h>
#include <avr/interrupt.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#define MAX_BUFFER 32
char b[MAX_BUFFER];
uint8_t l = 0;
ISR(USART1_RX_vect) {
char c = fgetc(stdin);
printf("%c", c);
@ebith
ebith / limoo.js
Last active Sep 22, 2017
通知したり読み上げたりするIRC bot (node limoo.js --port 6667 --host irc.foobar.baz --password ****** --name qux --ssl --insecure)
View limoo.js
const argv = require('minimist')(process.argv.slice(2));
const net = argv.ssl ? require('tls') : require('net');
const irc = require('slate-irc');
const dns = require('dns');
const exec = require('child_process').exec;
const growl = require('growly');
const growlIcon = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAB0VBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////P+BsGAAAAmnRSTlMAAQIDBAUGBwgJCgsMDRARExQVFhcYGhscHR4fICEiIyQlJicp
@ebith
ebith / .vimperatorrc
Created Feb 9, 2017
TwittperatorでURL付きツイートする時よしなにしてくれるやつ
View .vimperatorrc
javascript <<EOM
twtu = (title, url) => {
const args = commandline.command.split(/\s+/);
const text = args.slice(1, -1).join(' ');
const match = /^@\w{1,15}(#\d+)$/.exec(args[1]);
const r = 140 - 23 - text.length + (match ? match[1].length : 0);
if (title.length > r-7) {
title = title.slice(0, r-7) + '\u2026'
}
return `"${title}" - ${url}`;
@ebith
ebith / extractArchive.js
Last active Oct 1, 2019
7-Zip付属の7zG.exeで二重フォルダを防ぎ賢く展開するWSH JScript
View extractArchive.js
var wshell = new ActiveXObject('WScript.Shell');
var fso = new ActiveXObject( 'Scripting.FileSystemObject');
var archivePath = WScript.arguments(0);
var dirPath = wshell.currentDirectory + '/' + fso.getBaseName(archivePath);
var process = wshell.Exec('"C:/Program Files/7-zip/7zG.exe" x "' + archivePath + '" -aou -spe -o"' + dirPath + '"');
while (process.status !== 1) {
WScript.sleep(10);
}
@ebith
ebith / say.js
Created Jul 31, 2016
say command for Windows
View say.js
var args = [];
for (var i = 0; i < WScript.Arguments.length; i++) {
args.push(WScript.Arguments(i));
}
new ActiveXObject('SAPI.SpVoice').Speak(args.join(' '));
View steam-queue-clicker.user.js
// ==UserScript==
// @name steam queue clicker
// @version 1.0
// @author ebith
// @include http://store.steampowered.com/app/*
// @include http://store.steampowered.com/explore/
// @noframes
// ==/UserScript==
document.addEventListener('DOMContentLoaded', () => {
View Docker-cheatsheet.md

Docker Cheatsheet

Commands

イメージを起動する C-p C-qでデタッチ

docker run --interactive --tty IMAGE

デーモンモードで起動する

docker run --detach --interactive --tty IMAGE