Skip to content

Instantly share code, notes, and snippets.

View mfakane's full-sized avatar

mfakane mfakane

View GitHub Profile
@mfakane
mfakane / replace_email_address_placeholders.user.js
Last active February 23, 2023 23:35
User Script for generating email aliases
// ==UserScript==
// @name Generate random email address from placeholders
// @namespace https://github.com/mfakane
// @version 0.1
// @description Automatically replaces placeholders in email addresses during input. Intended to use with plus aliases (e.g. yourusernamehere+XXXX@gmail.com) or custom domains (e.g. HOSTNAME+XXXX@example.com)
// @author mfakane
// @match http://*/*
// @match https://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
@mfakane
mfakane / FlipSelectedString.ahk
Created June 5, 2020 19:42
選択文字列を前後反転
^+r::
ClipSaved := ClipboardAll
Send ^c
ClipWait
Clipboard := Flip(Clipboard)
Send ^v
Clipboard := ClipSaved
ClipSaved =
Return
@mfakane
mfakane / discord.css
Created March 31, 2020 12:56
BetterDiscord 向けの、チャンネル一覧とメンバー一覧を折りたたんでマウスオーバーで展開するカスタム CSS
.sidebar-2K8pFh {
width: 64px;
transition: all 0.25s ease;
}
.sidebar-2K8pFh:hover {
width: 240px;
}
.panel-24C3ux, .container-3baos1, .container-1giJp5 {
padding-left: 16px;
@mfakane
mfakane / auto-poweroff.sh
Last active February 13, 2020 15:21
BRAVIA の HTTP API を使って外部信号入力がないときに自動電源オフ (HDMI 以外のことは全く考慮してないので注意)
#!/bin/sh
# Get external input states
input_statuses=$(./bravia-cmd.sh avContent getCurrentExternalInputsStatus 105 '[]' 1.1 | jq -c '.result[][]')
while IFS= read -r input; do
if [[ $(echo $input | jq -r '.status') = 'true' ]]; then
# When input signal is detected
uri=$(echo $input | jq -r '.uri')
current_input=$(./bravia-cmd.sh avContent getPlayingContentInfo 103 '[]' 1.0)
@mfakane
mfakane / betterlightdiscord.css
Created March 6, 2018 18:34
BetterDiscord 設定メニュー Light Theme 合わせ
.theme-light #bd-settingspane-container h2.ui-form-title,
.theme-light #bd-settingspane-container .ui-switch-item h3 {
color: #4f5f5c;
}
.theme-light #bd-settingspane-container .ui-switch-item .style-description {
color: hsla(218, 5%, 47% .6);
}
.theme-light #bd-settings-sidebar .ui-tab-bar-item {
@mfakane
mfakane / update-iptables.sh
Last active February 15, 2018 16:59
国による IP ブロック
#!/bin/bash
cd /tmp
curl -O http://nami.jp/ipv4bycc/cidr.txt.gz && gunzip -f cidr.txt.gz
ipset create -exist WHITELIST hash:net
ipset flush WHITELIST
sed -n 's/^JP\t//p' cidr.txt | while read ADDRESS; do ipset add WHITELIST $ADDRESS; done
ipset create -exist BLACKLIST hash:net
@mfakane
mfakane / keybase.md
Last active March 30, 2023 08:34
Keybase proof

Keybase proof

I hereby claim:

  • I am mfakane on github.
  • I am mfakane (https://keybase.io/mfakane) on keybase.
  • I have a public key ASBe-4DFcnP4z92y47ut8BzkM1RDw--0treUlgt83q346go

To claim this, I am signing this object:

@mfakane
mfakane / .nanorc
Created March 15, 2017 09:25
これが私の .nanorc
include "/usr/share/nano/*.nanorc"
set autoindent
set const
set cut
set morespace
#set mouse
set multibuffer
set nohelp
set nonewlines
@mfakane
mfakane / MethodBinding.cs
Created December 6, 2016 16:11
Loaded="{foo:MethodBinding BarMethod}" みたいにできるやつの作りかけ
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Windows;
using System.Windows.Markup;
namespace Test
{
[MarkupExtensionReturnType(typeof(Delegate))]
class MethodBinding : MarkupExtension
@mfakane
mfakane / get-nicovideo.sh
Last active December 6, 2016 18:38
Download video from nicovideo
#!/bin/sh
PROGNAME=$(basename $0)
#urldecode="nkf --url-input"
urldecode='eval echo -e $(sed "s/+/ /g; s/%/\\\\x/g")'
account=""
password=""
cookie=""
savecookie=""
outdir="."