Skip to content

Instantly share code, notes, and snippets.

View okabe-yuya's full-sized avatar
🏠
Working from home

okbee okabe-yuya

🏠
Working from home
View GitHub Profile
@okabe-yuya
okabe-yuya / diff.md
Created December 3, 2020 03:03
ファイル間の差分を確認する

ファイル全ての差分を確認する

diff -r dirA dirB

差分のあるファイルのみを確認する

diff -rq dirA dirB

@okabe-yuya
okabe-yuya / interval.js
Created January 1, 2021 13:05
slow down interval execution in javascript
const slowDownInterval = (ms, limit=10) => {
_slowDownInterval(ms, limit, 0);
}
const _slowDownInterval = (ms, limit, counter) => {
const sleepTimme = ms + (counter * 100);
if (limit > counter) {
setTimeout(() => {
console.log(`Interval: count => ${counter} ...`);
_slowDownInterval(ms, limit, counter + 1);
@okabe-yuya
okabe-yuya / setInterval_sample.js
Created January 3, 2021 05:59
unawait interval
const sleep = (ms) => {
setTimeout(() => undefined, ms);
};
const intervalCount = (ms) => {
let counter = 0;
setInterval(() => {
console.log("[Info] count: ", counter)
counter++;
}, ms);
@okabe-yuya
okabe-yuya / await_interval.js
Last active January 3, 2021 06:35
await interval function
const interval = async (ms, callback, continueCond) => {
const _interval = async () => {
await new Promise(resolve => {
setTimeout(resolve, ms);
});
if (continueCond()) {
callback();
await _interval();
}
@okabe-yuya
okabe-yuya / .vimrc
Last active April 1, 2021 05:48
わたしの
" syntax support
syntax on
set nocompatible
set backspace=indent,eol,start
set tabstop=2
set shiftwidth=2
set number
set expandtab
set autoindent
set title
const interval = async (msFunc, callback, continueCond) => {
const _interval = async () => {
const sleepTime = msFunc();
console.log("sleepTime: ", sleepTime);
await new Promise(resolve => {
setTimeout(resolve, sleepTime);
});
if (continueCond()) {
callback();
@okabe-yuya
okabe-yuya / current_branch.sh
Created May 13, 2021 03:17
get current branch name
echo $(git branch | grep "*" | sed -e "s/\* //")
@okabe-yuya
okabe-yuya / merge.py
Created July 21, 2021 04:09
csvとtxtファイルを結合するためのそれ
import pandas as pd
import os
import datetime
# -------------------------------------------------
EXIST_DATA_DIR = "data"
FULL_PATH = os.getcwd()
DATA_PATH = os.path.join(FULL_PATH, EXIST_DATA_DIR)
ALLOWD_EXTENSION = [".csv", ".txt"]
# -------------------------------------------------

私は帰ってきた(自分目線)

初めまして。苗字が岡部なのでOKBと名乗っています
決してどこかの銀行を真似しているわけではありません
ブログ開設時(20190326)の時点で僕は22歳です
大学の学部を卒業したばかりの新米です

色々ありまして...はてなブログで再びブログを開設しました
以前はwordpressで筋トレのブログを書いていたんですけど普通に挫折しました
理由はネタ切れでした。書くことが無くなってしまったんです。御察しの通り...
筋トレってそんなすぐに変化でなくて記事にしにくかった(ボソ

@okabe-yuya
okabe-yuya / memory_bloat_per.rb
Last active August 18, 2021 04:30
メモリ断片化の割合の算出式
def calculate
100 - (GC.stat[:heap_live_slots] / (GC.stat[:heap_eden_pages] * GC::INTERNAL_CONSTANTS[:HEAP_PAGE_OBJ_LIMIT] ))
end