Skip to content

Instantly share code, notes, and snippets.

View mitsu-ksgr's full-sized avatar
🍣
🍶 🍣

mitsu-ksgr mitsu-ksgr

🍣
🍶 🍣
View GitHub Profile
@mitsu-ksgr
mitsu-ksgr / buffs_hungry_and_thirsty.xml
Last active September 24, 2020 19:12
7Days to die, Config/buffs.xml の 空腹・口渇 の debuff 部分の設定の抜粋
<!--
7Days to die, Config/buffs.xml の 空腹・口渇 の debuff 部分の設定の抜粋
-->
<buffs>
<!-- デバフの追加 -->
<buff name="buffStatusCheck01" hidden="true" remove_on_death="false">
<update_rate value="2"/>
<effect_group>
<triggered_effect trigger="onSelfBuffUpdate" action="AddBuff" buff="buffStatusHungry01">
<requirement name="StatComparePercCurrentToMax" stat="Food" operation="LTE" value=".5"/>

GPD P2 max

Device Manager (windows)

  • Audio inputs and outputs
    • Microphone (Realtek(R) Audio)
    • Speakers (Realtek(R) Audio)
  • Batteries
    • Microsoft AC Adapter
  • Microsoft ACPI-Compliant Control Method Battery
@mitsu-ksgr
mitsu-ksgr / get_image_size.sh
Created August 17, 2019 08:21
get image size in shellscript
#!/bin/bash
# require: image magick
file_path="/path/to/image.png"
size=$(identify -format "%w,%h" $file_path)
w=${size%,*}
h=%{size##*,}
@mitsu-ksgr
mitsu-ksgr / fluentd.conf
Last active November 30, 2018 02:57
Rails のログメッセージにマッチする fluentd / td-agent の正規表現
# Rails のログメッセージにマッチする正規表現
<source>
@type tail
path /app/log/development.log
pos_file /var/log/td-agent/rails-development.log.pos
tag rails.app.log
<parse>
@type regexp
# [DIWEF] の中身を変更すれば、取得したいログレベルを調整できる
@mitsu-ksgr
mitsu-ksgr / shift.sh
Created November 15, 2018 22:00
bash shift example
#!/bin/sh
set -e
#------------------------------------------------------------------------------
# shift sample
#
#
# $ ./shift.sh a b c [shell]
# > ARGV: 3, ARGS: [a b c], Shifted: [b c]
@mitsu-ksgr
mitsu-ksgr / eto.js
Created September 16, 2018 18:05
干支を返す
/**
* 指定した西暦の干支を返す.
*
* @example
* console.log(`2018: ${getEto(2018)}`); //> '2018: 戊,戌'
*
* @param {number} year - 西暦
* @return {Array<string>} [0] 十干, [1] 十二支
*/
const getEto = (year) => {
# Sample variables file for BCM94356Z NGFF 22x30mm iPA, iLNA board with PCIe for production package
NVRAMRev=$Rev: 492104 $
#4356 chip = 4354 A2 chip
sromrev=11
boardrev=0x1102
boardtype=0x073e
boardflags=0x02400201
#0x2000 enable 2G spur WAR
boardflags2=0x00802000
boardflags3=0x0000000a
@mitsu-ksgr
mitsu-ksgr / generateUUID.js
Created August 3, 2018 16:46
Generate a UUID compliant with RFC4122 v4.
/**
* Generate a UUID compliant with RFC4122 v4.
* @see https://stackoverflow.com/a/2117523
*/
function generateUUID() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
@mitsu-ksgr
mitsu-ksgr / .Xresources
Created June 11, 2018 11:09
tmp xresources
!!
!! ~/.Xresources
!!
!==============================================================================
!
! rxvt-unicode-256color
!
!==============================================================================
@mitsu-ksgr
mitsu-ksgr / detect_encode.py
Last active December 18, 2019 06:14
Detect file encoding in python3 with chardet
#! /usr/bin/env python
# coding: utf-8
import os
import sys
from chardet.universaldetector import UniversalDetector
def detect_encoding(file_path):
detector = UniversalDetector()
detector.reset()