Skip to content

Instantly share code, notes, and snippets.

kei-s / .gdbinit
Last active Feb 28, 2018
mecab-python3 デバッグメモ
View .gdbinit
set breakpoint pending on
b _wrap_Tagger_parseToNode
View comparable_bench.rb
# frozen_string_literal: true
require 'benchmark'
class SizeMatters
include Comparable
attr :str
def <=>(other)
str.size <=> other.str.size
def initialize(str)
kei-s / clamp_bench.rb
Last active Sep 19, 2017
Comparable#clamp improvement
View clamp_bench.rb
require 'benchmark'
Benchmark.bmbm do |x|
v = Random.rand(-10..110) "minmax:" do
10000000.times { [99, [0, v].max].min }
end "clamp: " do
View gist:09b3f34848c6c1293de1f6e99c90cdc1
### Keybase proof
I hereby claim:
* I am kei-s on github.
* I am kei_s ( on keybase.
* I have a public key whose fingerprint is 6B52 13DA 6F4B 48F5 5B42 AE34 931D 3783 8649 E80C
To claim this, I am signing this object:
kei-s / hikisuu.rb
Created May 19, 2017
View hikisuu.rb
@gomobako = 🗑
def gomibako_ni_suteru(gomi)
cd = 💿
if cd.wareta?
View Post.js
// 1. Enter sheet name where data is to be written below
var SHEET_NAME = "購入ログ";
// 2. Run > setup
// 3. Publish > Deploy as web app
// - enter Project Version name and click 'Save New Version'
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
View sendMail.js
function sendMail() {
var today = new Date();
var MAIL_TO = "メールアドレス";
var cycles = (function() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("サイクル");
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
var values = rows.getValues();
return values;
View answer_exercise_gotour_70.go
package main
import (
// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {
View pivotal-to-trello.rb
require 'csv'
require 'pry'
require 'trello'
Trello.configure do |config|
config.developer_public_key = 'TRELLO_PUBLIC_KEY'
# Access{substitutewithyourapplicationkey}&name=My+Application&expiration=1day&response_type=token&scope=read,write
config.member_token = 'ACCESS_TOKEN'
View answer_exercise_gotour_61.go
package main
import (
type rot13Reader struct {
r io.Reader