Skip to content

Instantly share code, notes, and snippets.

View drobune's full-sized avatar

Yuichi Sano drobune

View GitHub Profile
@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}'` &
}
@drobune
drobune / emacs.ahk
Created July 22, 2016 03:22
Windows10 AutoHotkeyの設定
;================================================================
;auto hot key script for windows
;mac風キーバインド
;================================================================
#InstallKeybdHook
#UseHook
;================================================================
;関数
@drobune
drobune / Home.sh
Created May 11, 2016 03:39
Homeボタンをシミュレートする(xbindkeysでCtrl-aを割り当てる)
#!/bin/bash -xe
id=`xdotool getwindowfocus`
xdotool key --window $id Home > /dev/null 2>&1