Skip to content

Instantly share code, notes, and snippets.

View tmokmss's full-sized avatar

Masashi Tomooka tmokmss

View GitHub Profile
@tmokmss
tmokmss / stackdriver_logger.rb
Last active November 9, 2019 16:36
stackdriver logger patch for usability
require "google/cloud/logging"
class StackdriverLogger < Google::Cloud::Logging::Logger
module EntryRefinement
refine Google::Cloud::Logging::Entry do
attr_accessor :http_request
end
end
using EntryRefinement
@tmokmss
tmokmss / result.md
Last active June 12, 2018 12:58
the difference of processing speed with various "push back" method

Result

All the results are shown in second.

benchmark A

Debug

num push_back resize reserve emplace_back reserve alt resize alt
0 0 0 0 0 0 0
2000000 1.39 0.422 0.984 1.312 0.953 0.406
4000000 2.813 0.843 1.985 2.734 1.906 0.797
@tmokmss
tmokmss / 1. main.gs
Last active May 26, 2018 14:25
GASによる永続化方法
function main() {
var count_before = loadCount();
var count_today = getCountToday();
var count_sum = count_before + count_today;
Logger.log(count_sum);
saveCount(count_sum);
}
function getCountToday() {
@tmokmss
tmokmss / EchoTest.cs
Last active April 28, 2018 09:01
A successful WebSocket server and client set
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System;
public class EchoTest : MonoBehaviour {
WebSocket w;
int myid = -1;
public Text output;