Skip to content

Instantly share code, notes, and snippets.

s_hiiragi s-hiiragi

  • Tokyo, Japan
Block or report user

Report or block s-hiiragi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@s-hiiragi
s-hiiragi / shortcutkey_settings.json
Last active Jul 17, 2019
Settings of 'Shortkeys' google chrome extension for DOVA-SYNDROME (dova-s.jp)
View shortcutkey_settings.json
[{"action":"javascript","blacklist":"whitelist","code":"iframe = document.querySelector('#YouTube > iframe')\nid = iframe.src.match(/([0-9a-zA-Z]+)?$/)[0]\nhistory.go(id?-1:-2)","customName":"Go back","exported":true,"key":"a","open":false,"sites":"https://dova-s.jp/bgm/play*","sitesArray":["https://dova-s.jp/bgm/play*"]},{"action":"javascript","blacklist":"whitelist","code":"console.log('-- Play youtube movie')\niframe = document.querySelector('#YouTube > iframe')\nid = iframe.src.match(/([0-9a-zA-Z]+)?$/)[0]\nif (id) {\n\tiframe.src += `?autoplay=1&playlist=${id}&muted=1&`\n playedBgms = JSON.parse(localStorage.getItem('playedBgms')) || {}\n \ttitle = document.querySelector('#titleYouTube > h2').firstChild.textContent.trim()\n playedBgms[location.pathname] = title\n localStorage.setItem('playedBgms', JSON.stringify(playedBgms))\n console.log(playedBgms)\n} else {\n \thistory.go(-2)\n}","customName":"Play bgm","exported":true,"key":"space","open":false,"sites":"https://dova-s.jp/bgm/play*","sit
View ast_practice_1.py
import ast
source = """
name = "Inu"
age = 10
print("Hello, {}({})!".format(name, age))
"""
tree = ast.parse(source)
@s-hiiragi
s-hiiragi / selection_sample.js
Last active Feb 7, 2017
選択範囲をレイアウト座標とロジック座標で相互変換するサクラエディタマクロのサンプル
View selection_sample.js
/**
* @file sakura_selection_sample.js
*
* 注:Shift_JISで保存してください (サクラエディタマクロの制約事項)
*/
/**
* 選択範囲(レイアウト座標)
*
* @param {number} lineFrom 選択開始行(レイアウト座標)
@s-hiiragi
s-hiiragi / flag_sample.go
Created Feb 6, 2017
Goでコマンドライン引数をパースするサンプル
View flag_sample.go
/*
* $ go run flag_sample.go -i 100 -s "strflag" 1 2 3
* os.Args: [/.../os_args_sample -i 100 -s strflag 1 2 3]
* flag.Args: [1 2 3]
* b: false
* i: 100
* s: strflag
*/
package main
@s-hiiragi
s-hiiragi / flagset_sample.go
Last active Feb 6, 2017
Goで配列をコマンドラインとしてパースするサンプル
View flagset_sample.go
package main
import (
"flag"
"fmt"
)
func main() {
var (
boolFlag bool
@s-hiiragi
s-hiiragi / csv_read_sample.go
Last active Feb 6, 2017
GoでCSVファイルを読み込むサンプル
View csv_read_sample.go
package main
import (
"fmt"
"os"
"io"
"encoding/csv"
)
func main() {
@s-hiiragi
s-hiiragi / exec_sample.go
Created Feb 6, 2017
Goで外部コマンドを実行して標準出力を得るサンプル
View exec_sample.go
package main
import (
"fmt"
"log"
"os/exec"
)
func main() {
out, err := exec.Command("ls", "-l").Output()
@s-hiiragi
s-hiiragi / regexp_sample.go
Last active Feb 6, 2017
Goで正規表現にマッチする文字列を取り出すサンプル
View regexp_sample.go
package main
import (
"fmt"
"regexp"
)
func main() {
fmt.Println("Hello, playground")
@s-hiiragi
s-hiiragi / translate_english.js
Last active Mar 8, 2018
選択した英文を日本語に翻訳するサクラエディタマクロ
View translate_english.js
/**
* @file 選択した英文を日本語に翻訳
*
* 注:Shift_JISで保存してください (サクラエディタマクロの制約事項)
*/
var text = Editor.GetSelectedString(0)
.replace(/\r\n/g, '\n')
.replace(/\t/g, '')
.replace(/\. /g, '.\n');
You can’t perform that action at this time.