Skip to content

Instantly share code, notes, and snippets.

View drobune's full-sized avatar

Yuichi Sano drobune

View GitHub Profile
@drobune
drobune / convert.js
Last active March 14, 2025 07:14
cosense_to_google_docs
// 代表的なページタイプを取得して、最終的な移行計画を作成
const fileContent = await window.fs.readFile('tdwda.json', { encoding: 'utf8' });
// ページタイトルとIDのマッピングを作成(後でディレクトリ構造に使用)
const titleToIdMap = {};
const pagePattern = /"title":"([^"]+)","created":(\d+),"updated":(\d+),"id":"([^"]+)","views":(\d+)/g;
let match;
while ((match = pagePattern.exec(fileContent))) {
const title = match[1];
#!/bin/bash -e
# take screenshot to clipboard
#flameshot gui -r | xclip -selection clipboard -t image/png
selection=$(hacksaw -f "-i %i -g %g")
shotgun $selection - | xclip -t 'image/png' -selection clipboard
@drobune
drobune / ボーリング.java
Last active July 10, 2023 08:54
アジャイル本のボウリング実装コード
// Game.java-
public class Game
{
public int score()
return scoreForFrame (its Current Frame);
${
}
public void add (int pins)
{
}
@drobune
drobune / ボーリング.java
Last active July 10, 2023 08:43
ChatGPTボウリング実装チャレンジ、SRPヴァージョン
import java.util.ArrayList;
import java.util.List;
class Game {
private List<Frame> frames;
public Game() {
frames = new ArrayList<>();
}
@drobune
drobune / setup.sh
Last active December 20, 2018 10:15
wsl setup
sudo apt-get install curl jq git tig openssl ca-certificates build-essential software-properties-common iproute2
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
curl -LO https://github.com/ogham/exa/releases/download/v0.8.0/exa-linux-x86_64-0.8.0.zip
unzip exa-linux-x86_64-0.8.0.zip
sudo chown root:root exa-linux-x86_64 && sudo mv exa-linux-x86_64 /usr/bin/exa
curl -LO https://github.com/sharkdp/bat/releases/download/v0.4.1/bat_0.4.1_amd64.deb
sudo dpkg -i bat_0.4.1_amd64.deb && rm bat_0.4.1_amd64.deb
@drobune
drobune / tweet2scrapbox.rb
Last active October 30, 2017 12:51
twitterのarchive dataをscrapbox形式に変換する。ハッシュタグも適当に振る
require 'csv'
require 'uri'
require 'time'
require 'natto'
require 'json'
nm = Natto::MeCab.new
wordHash = {}
charset = nm.dicts.first.charset
require 'open-uri'
require 'nokogiri'
require 'json'
def get_content(url)
charset = nil
html = open(url) do |f|
charset = f.charset
f.read
end
require 'open-uri'
require 'nokogiri'
def get_content(url)
charset = nil
html = open(url) do |f|
charset = f.charset
f.read
end
@drobune
drobune / gist:0dbb429a778a148083a7885ede5dc02e
Created August 1, 2016 15:28
natural scroll on t420 win10
WheelUp::
Send {WheelDown}
Return
WheelDown::
Send {WheelUp}
Return
#!/bin/bash
# Delay before starting
DELAY=1
# Beep to let one know when recording is about to start (and ends)
beep() {
echo -e "\007" > /dev/`who | awk '{print $2}'` &
}