def sample()
p 'hello, world'
end
$ echo hello
hello
import java.awt.Graphics2D; | |
import java.awt.Image; | |
import java.awt.image.BufferedImage; | |
import java.io.BufferedOutputStream; | |
import java.io.BufferedWriter; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.FileWriter; | |
import java.io.IOException; |
auto start = std::chrono::system_clock::now(); | |
// ----- | |
// 処理 | |
// ----- | |
CCLOG("1: %lld マイクロ秒", std::chrono::duration_cast<chrono::microseconds>(chrono::system_clock::now() - start).count()); |
class AddTriggerToClanChat < ActiveRecord::Migration | |
# MySQL のトリガーは同テーブルへの変更が不可能なため実行時にエラーとなる | |
def up | |
execute <<-SQL | |
CREATE TRIGGER trigger_delete_chat AFTER INSERT ON room_chats | |
FOR EACH ROW | |
BEGIN | |
DECLARE num INT; | |
SELECT COUNT(*) INTO num FROM room_chats WHERE room_id = new.room_id; |
" ================ General Config ==================== | |
set encoding=utf-8 | |
set autoread | |
" ================ Editor Display ==================== | |
set number | |
set title | |
set ruler | |
set cursorline | |
set nowrap |
def sample()
p 'hello, world'
end
$ echo hello
hello
array = [ | |
{ id: 1, lv: 56 }, | |
{ id: 2, lv: 12 }, | |
{ id: 3, lv: 38 }, | |
{ id: 4, lv: 99 }, | |
{ id: 5, lv: 27 }, | |
] | |
p array.max { |a, b| a[:lv] <=> b[:lv] } # => {:id:4, lv:99} | |
p array.max_by { |v| v[:lv] } # => {:id:4, lv:99} |
FROM nginx:mainline-alpine | |
HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=1 \ | |
CMD wget -q -O - http://localhost/ || exit 1 | |
CMD ["nginx", "-g", "daemon off;"] |
FROM grpc/cxx | |
WORKDIR /workspace | |
RUN mkdir codegen | |
COPY ./protobuf /workspace/protobuf | |
CMD protoc \ | |
--proto_path=./protobuf \ | |
--grpc_out=./codegen --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` \ | |
./protobuf/rpc/*.proto \ |
#! /bin/bash | |
IMAGE_NAME=gen-grpc-cpp | |
CONTAINER_NAME=codegen-cpp | |
SRC_DIR=/workspace/codegen/rpc | |
DEST_DIR=./codegen | |
# change working directory to project root | |
cd $(dirname $0)/../ |
The script in this gist will help you buid the Google Protobuf library for use with Mac OS X and iOS. Other methods (such as homebrew or direct compilation) have issues that prevent their use. The libraries built by this script are universal and support all iOS device architectures including the simluator.
The easiest way to use this script is to simply clone the gist onto your