Skip to content

Instantly share code, notes, and snippets.

View aiotter's full-sized avatar
🦦
otter driven development

Yuto Oguchi aiotter

🦦
otter driven development
View GitHub Profile
@aiotter
aiotter / ssh.sh
Last active August 2, 2023 01:05
Register aiotter's ssh key
#!/bin/sh
mkdir -p ~/.ssh
cat <<EOS >>~/.ssh/authorized_keys
ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBC989H9RvLj9r2nxqj5cS8pN0fvcglmY/C/4bVbkOXufyMMvujbDr4ME5ba3rxsLJySavmkXtYt1v5+wDTiFC1gNHsIx3FYpI71hF61tWg/SpuIoOMyI82smszaFHq/eXw== aiotter@yubikey5c
EOS
@aiotter
aiotter / uBlacklist.txt
Last active January 10, 2022 08:45
Personal uBlacklist subscription
*://bleepcoder.com/*
*://ja.uwenku.com/*
*://www.webdevqa.jp.net/*
*://codehero.jp/*
*://www.sejuku.net/*
*://techacademy.jp/*
*://ichi.pro/*
*://qastack.jp/*
@aiotter
aiotter / grep
Last active July 4, 2022 23:58
better grep (silently use ripgrep if available)
#!/usr/bin/env python3
# Copyright 2021 aiotter
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T
@aiotter
aiotter / Dockerfile
Created July 14, 2020 10:09
my neovim
FROM alpine:latest
ENV PYTHON_VER 3.8
ENV HOME_LOCAL /root/.local
RUN apk update; \
apk add --no-cache git curl bash build-base libffi-dev openssl-dev bzip2-dev zlib-dev readline-dev sqlite-dev
RUN mkdir -p /tmp/python-build; \
cd /tmp/python-build || exit 1; \
@aiotter
aiotter / mysettings.json
Last active October 12, 2020 07:04
Karabiner-elements complex-modification
{
"title": "aiotter personal settings",
"rules": [
{
"description": "Caps_lock to control if pressed with other keys, to escape and set IME off if pressed alone.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
@aiotter
aiotter / custom.css
Created March 22, 2020 06:50
Zettlr custom.css (/Users/aiotter/Library/Application Support/zettlr/custom.css)
#editor {
font-family: arial, sans-serif
}
#editor .CodeMirror .cm-comment, #editor .CodeMirror .cm-fenced-code, #editor .CodeMirror .cm-formatting-task {
font-family: Cica,'Liberation Mono',monospace;
}
#editor .cm-string {
text-decoration: underline;
@aiotter
aiotter / freezer.py
Created February 28, 2019 15:24
FrozenDict, FrozenList
from collections.abc import Mapping, MutableSequence
class FrozenObj:
def __getattr__(self, item):
if isinstance(self, Mapping):
return FrozenDict.__build(self[item])
else:
raise AttributeError
def __getitem__(self, key):
@aiotter
aiotter / invite_detect.py
Last active June 15, 2019 10:02
Cog InviteDetector to know via which invite they joined. (See lines below 97 for actual usage)
#!/usr/bin/env python3
#coding:utf8
import discord
from discord.ext import commands
class InviteDetector:
"""To detect invite, the bot has to have manage_guild permission for that guild"""
def __init__(self, bot):
self.bot = bot