Skip to content

Instantly share code, notes, and snippets.

Avatar
🍕
Thanks Driven Development

Wataru MIYAGUNI gongo

🍕
Thanks Driven Development
View GitHub Profile
@gongo
gongo / eww-hatebu-nicomment.el
Last active Jul 26, 2019
eww (Emacs Web ブラウザ) でアクセスしたページの、はてなブックマークコメントをニコニコ動画っぽく表示してくれるやつ https://twitter.com/gongoZ/status/1154568260139941888
View eww-hatebu-nicomment.el
(require 'deferred)
(require 'request-deferred)
(require 'eww)
(defun eww-hatebu-nicomment ()
(let ((url (url-hexify-string (eww-current-url))))
(deferred:$
(request-deferred (concat "http://b.hatena.ne.jp/entry/jsonlite/?url=" url)
:type "GET"
:parser 'json-read)
@gongo
gongo / csv.rb
Created Jun 24, 2019
ヘッダが異なる CSV::Row を混ぜていい感じに csv 作りたい
View csv.rb
row1 = CSV::Row.new(['a', 'b'], [1, 2])
row2 = CSV::Row.new(['a', 'c'], [4, 12])
table = CSV::Table.new([row1, row2])
table.to_s
#
# expected:
#
# a,b,c
@gongo
gongo / gist:c5a5ecef02ddf023c3d76381022d6755
Last active Mar 2, 2018
YAPC::Okinawa 勢向け「沖縄・食」
View gist:c5a5ecef02ddf023c3d76381022d6755
View imascg_stage_event.org
日付イベントptスタドリ10スタドリ20スタドリ30スタドリMAX(84)合計(スタミナ)
5/1926781010100600
5/205156101270550
5/2114113101410111604
5/2216237010020
5/232030700000
5/24420031011100620
5/25511051010100600
5/26524801012100640
View shellcheck
#!/bin/sh
(
dir="$(cd "$(dirname "$1")" && pwd)"
name="$(basename "$1")"
docker run --rm -v "${dir}:/scripts" koalaman/shellcheck "/scripts/${name}"
)
View xmas-tree.el
(require 'gamegrid)
(defconst xmas-tree-buffer-name "*XMASTREE*")
(defconst xmas-tree--display-padding-top 5)
(defconst xmas-tree--display-padding-left 3)
(defvar xmas-tree--display-width)
(defvar xmas-tree--display-height)
(defvar xmas-tree--leafs nil)
@gongo
gongo / main.tf
Last active Dec 20, 2016
terraform plan displays "value of 'count' cannot be computed" https://github.com/hashicorp/terraform/issues/10857
View main.tf
# /path/to/main.tf
variable "aws_access_key" {}
variable "aws_secret_key" {}
provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "ap-northeast-1"
View sushi-bar-mode.el
(make-variable-buffer-local
(defvar sushi-bar--conveyor-belt ""))
(make-variable-buffer-local
(defvar sushi-bar--backup-mode-line-format nil))
(defvar sushi-bar--updater-object nil)
(defun sushi-bar--sushi-is-ready-p ()
(eq (random 15) 1))
@gongo
gongo / pizza_order.sh
Last active Nov 17, 2016
シェルスクリプトの関数コメントのスタイル、いい感じの模索してる
View pizza_order.sh
#!/bin/sh
#
# Short description
#
# Long description (multiline)
# :pizza: :pizza: :pizza:
#
# Examples:
#