Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️

Ryuichi Ito amaya382

🕶️
View GitHub Profile
@amaya382
amaya382 / lambda_function.py
Last active Jan 9, 2020
fetch and notify papers from arXiv
View lambda_function.py
# based on https://www.takapy.work/entry/2019/07/15/121436
import os
import re
import json
import urllib.request
import datetime
def parse_xml(data, tag):
pattern = "<" + tag + ">([\s\S]*?)<\/" + tag + ">"
@amaya382
amaya382 / stylus.css
Created Nov 21, 2019
Eliminate windows fonts
View stylus.css
@font-face {
font-family: "MS Pゴシック";
src: local("剣暎ゴシックP");
}
@font-face {
font-family: "MS ゴシック";
src: local("剣暎ゴシックP");
}
@font-face {
font-family: "メイリオ";
@amaya382
amaya382 / 90-mtrack.conf
Created Sep 10, 2019
/etc/X11/xorg.conf.d/
View 90-mtrack.conf
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
Driver "mtrack"
# Acceleration and Sensitivity
Option "AccelerationProfile" "2"
Option "ConstantDeceleration" "2.4"
Option "Sensitivity" "1.35"
View seal.sh
#!/bin/bash -eu
# Prerequisites: helm-client, kubeseal, yq, GNU grep, and GNU sed
# $1: chart
# $2: values file
# $3: chart name
cat << EOF > $1/templates/secret.yaml
apiVersion: v1
View settings.json
{
"editor.minimap.enabled": false,
"window.title": "${dirty}${rootName}${separator}${appName} / ${activeEditorLong}",
"editor.fontSize": 15,
"editor.fontFamily": "Karen, Menlo, Monaco, 'Courier New', monospace",
"window.zoomLevel": 0,
"go.testFlags": [
"-v"
],
"breadcrumbs.enabled": true,
View foo.bash
# Not work, because of https://github.com/kubernetes/kubernetes/issues/20352
for label in ${labels//,/ }; do
if [ "${query}" != '' ]; then
query="${query} &&"
fi
query=${query}@.spec.selector.${label//=/\=\=\"}\"
done
$KUBECTL get rs --no-headers=true -o=jsonpath="{.items[?(${query})].metadata.name}" | xargs
# Use jq
@amaya382
amaya382 / surfingkeys.js
Last active Aug 12, 2021
surfingkeys.js
View surfingkeys.js
unmap('x');
unmap('r');
unmap('ZQ');
unmap('gx0');
unmap('gxt');
unmap('gxT');
unmap('gx$');
unmap('.');
settings.scrollStepSize = 150;
iunmap(":", /slack\.com|tweetdeck\.twitter\.com/);
@amaya382
amaya382 / tabs_to_bottom.css
Last active Jun 30, 2018 — forked from Arty2/tabs_to_bottom.css
Firefox CSS to move tabs and adress bar to bottom of window. Use with Stylish or userChrome.css (works with Firefox 57+)
View tabs_to_bottom.css
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* tabs to bottom */
#browser-panel { /* Deprecated since FF 59 */
-moz-box-direction: reverse;
padding: 0 !important;
}
#navigator-toolbox {
-moz-box-ordinal-group: 2;
View wol_ubuntu.sh
#!/bin/sh -eu
BRD='10.255.255.255' # for searching interface
enable_wol() {
sudo ethtool -s $1 wol g
sudo sh -c 'cat << EOF > /etc/systemd/system/wol@.service
[Unit]
Description=Wake-on-LAN for %i
Requires=network.target
View garbage.scala
object Main {
def main(args: Array[String]): Unit = {
case class =>>[T, U](f: T => Boolean, g: T => U)
implicit class Ex[T](f: T => Boolean) {
def =>>[U](g: T => U): T =>> U = new =>>(f, g)
}
def matchx1[T, U](target: T)(cases: (T =>> U)*): U = {
cases.collectFirst {
case cas if cas.f(target) => cas.g(target)