Skip to content

Instantly share code, notes, and snippets.

Fuminori Sakamoto goldeneggg

Block or report user

Report or block goldeneggg

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
goldeneggg / bench_uniq_reject.rb
Last active Dec 12, 2018
[ruby] 一覧から重複削除してnilを除去、の実装方法別パフォーマンス比較
View bench_uniq_reject.rb
require 'benchmark/ips'
require 'benchmark/memory'
require 'set'
@arr = ['1', '2', '33', '444', nil, '5555', nil, '444', '66666', 'abcde', '777777', nil, 'XXXX', '33', 'zzzzzzzzzz']
def self.label
goldeneggg / app.js
Last active Dec 7, 2018
AWS Lambdaの言語サポート状況を取得する為のLambda Function
View app.js
const axios = require('axios');
const cheerio = require('cheerio');
const url = '';
let $;
let response;
goldeneggg / kh2md.rb
Last active May 22, 2018
Kindle highlights to markdown for
View kh2md.rb
# Note:
# tagged version of kindle-highlights gem is not supported "root_url" option.
# So should use "master" branch version.
require "kindle_highlights"
puts "START kindle highlights output to markdown"
kindle = ENV['KINDLE_EMAIL'], password: ENV['KINDLE_PASSWD'], root_url: '')
kindle.books.each_with_index do |book, i|
puts "========== TITLE: #{book.title}"
goldeneggg / sslrails
Created Jul 4, 2016
ローカルのrailsをオレオレ証明書でSSL化して起動する `sslrails` コマンド
View sslrails
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rubygems'
require 'rails/commands/server'
require 'rack'
require 'webrick'
require 'webrick/https'
goldeneggg / attribute_convertable.rb
Created Oct 7, 2015
属性値の設定時に自動変換を行うconcern module
View attribute_convertable.rb
module AttributeConvertable
extend ActiveSupport::Concern
included do
# 全角英数字を半角英数字に変換
# (使用例.modelの定義)
# downcase_attr :hoge
# (使用例.modelへの値設定)
goldeneggg / slackrtm.go
Created Aug 3, 2015
WebSocket message receiver client for Slack
View slackrtm.go
package main
import (
goldeneggg /
Last active Aug 29, 2015
gocon 2015 summer のメモ



  • rakyll/boom (ベンチマークツール) のコード読み
  • mholt/caddy (HTTP2サーバ) のコード読み
  • yhat/scrape (超シンプルwebスクレイパ) のコード読み
  • パッケージの最近の状況把握
goldeneggg / stdin
Created Jun 18, 2015
View stdin
goldeneggg / grep.Body.Close.txt
Last active Mar 11, 2019
Go 1.4.2, grep "Body.Close"
View grep.Body.Close.txt
cmd/go/http.go-28-func httpGET(url string) ([]byte, error) {
cmd/go/http.go-29- resp, err := httpClient.Get(url)
cmd/go/http.go-30- if err != nil {
cmd/go/http.go-31- return nil, err
cmd/go/http.go-32- }
cmd/go/http.go:33: defer resp.Body.Close()
cmd/go/http.go-34- if resp.StatusCode != 200 {
cmd/go/http.go-35- return nil, fmt.Errorf("%s: %s", url, resp.Status)
cmd/go/http.go-36- }
cmd/go/http.go-37- b, err := ioutil.ReadAll(resp.Body)
goldeneggg / asanaevents.rb
Created May 20, 2015
View asanaevents.rb
require "json"
require "net/http"
require "uri"
require "pathname"
require "pp"
class AsanaEvents
SYNC_SAVE_PATH = "#{ENV['HOME']}/.asana_events_api/sync.txt"
You can’t perform that action at this time.