Skip to content

Instantly share code, notes, and snippets.

View cosmo0920's full-sized avatar
🏠
Working from home

Hiroshi Hatake cosmo0920

🏠
Working from home
View GitHub Profile
@cosmo0920
cosmo0920 / Makefile
Last active October 5, 2023 09:21
Reproduce Go plugin for channel issue
all:
go build -buildmode=c-shared -buildvcs=false -o in_repro.so .
fast:
go build in_repro.go
clean:
rm -rf *.so *.h *~
@cosmo0920
cosmo0920 / Gemfile
Last active November 12, 2018 09:51 — forked from okkez/Gemfile
Fluentd v0.14 対応済みのプラグインリスト
source "https://rubygems.org"
gem "gems"
gem "octokit"
gem "dotenv"
import cv2, matplotlib
import numpy as np
import matplotlib.pyplot as plt
import os
filename='yuudachi.png'
filename_base, ext = os.path.splitext(filename)
img = cv2.imread(filename, 1)
kernel = np.ones((3,3),np.uint8)
import cv2, matplotlib
import numpy as np
import matplotlib.pyplot as plt
import os
filename='yuudachi.png'
filename_base, ext = os.path.splitext(filename)
img = cv2.imread(filename, 1)
kernel = np.ones((3,3),np.uint8)
require "benchmark"
src = "[[tag, time, record['code'].to_i]]"
map = "#{src}"
tag = "foo"
time = 12345
record = {
"code" => "400"
}
class I686W64Mingw32Gcc < Formula
homepage "https://gcc.gnu.org"
url "http://ftpmirror.gnu.org/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2"
sha256 "5f835b04b5f7dd4f4d2dc96190ec1621b8d89f2dc6f638f9f8bc1b1014ba8cad"
resource "binutils" do
url "http://ftpmirror.gnu.org/binutils/binutils-2.25.1.tar.bz2"
sha256 "b5b14added7d78a8d1ca70b5cb75fef57ce2197264f4f5835326b0df22ac9f22"
end
@cosmo0920
cosmo0920 / mingw-w64-4.0.4-osx10.11.2.sh
Last active May 28, 2022 03:02 — forked from Drakulix/mingw-w64-3.10-osx10.9.sh
Script to install a Mingw-w64 Cross-Compiler Suite on Mac OS X 10.11.2
#!/bin/sh
# dependencies
echo "Installing dependencies via Homebrew (http://brew.sh)"
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
brew tap homebrew/versions
Test suite HDBC-mysql-test: RUNNING...
Cases: 38 Tried: 0 Errors: 0 Failures: 0
Cases: 38 Tried: 1 Errors: 0 Failures: 0
Cases: 38 Tried: 2 Errors: 0 Failures: 0
Cases: 38 Tried: 3 Errors: 0 Failures: 0
Cases: 38 Tried: 4 Errors: 0 Failures: 0
Cases: 38 Tried: 5 Errors: 0 Failures: 0
Cases: 38 Tried: 6 Errors: 0 Failures: 0
Cases: 38 Tried: 7 Errors: 0 Failures: 0
make all-recursive
make[1]: Entering directory `/home/milter-manager-build/rpm/BUILD/milter-manager-2.0.5'
Making all in libev-4.19
make[2]: Entering directory `/home/milter-manager-build/rpm/BUILD/milter-manager-2.0.5/libev-4.19'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wall -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wcast-align -MT ev.lo -MD -MP -MF .deps/ev.Tpo -c -o ev.lo ev.c
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wall -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wcast-align -MT event.lo -MD -MP -MF .deps/event.Tpo -c -o event.lo event.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -
@cosmo0920
cosmo0920 / mongo_insert_bench_latest.rb
Created October 27, 2015 04:17
Mongo Ruby Driver benchmark
require 'mongo'
require 'benchmark'
# setup
Mongo::Logger.level = Logger::WARN
options = {}
options[:database] = 'latest_bench'
client = Mongo::Client.new(["localhost:27017"], options)
puts "insert one by one"