Skip to content

Instantly share code, notes, and snippets.

View reizist's full-sized avatar
🖖
Working from home

Reiji Kainuma reizist

🖖
Working from home
View GitHub Profile
@reizist
reizist / optional_type.playground
Created December 15, 2014 16:02
Optional型の理解
// Playground - noun: a place where people can play
import UIKit
var str: String = "hoge"
// str = nil => NilLiteralConvertiable: 通常の型にnilは代入できない
var str2: Optional<String> = "hoge" // str2: String? = "hoge"と等しい
// str2 = nil => ok
// str2.upperCaseString => error: 'Optional<String>' does not have a member named
@reizist
reizist / gist:12f4ad87141d535dea75
Last active March 31, 2018 08:03
security_group.yml
AWSTemplateFormatVersion: 2010-09-09
Resources:
Basic:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Enable SSH access via port 22 and 80
SecurityGroupIngress:
- IpProtocol: tcp
CidrIp: 0.0.0.0/0
FromPort: 22
@reizist
reizist / doc.md
Created December 13, 2016 14:13 — forked from oelmekki/doc.md
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

require 'nokogiri'
require 'open-uri'
require 'pry'
require "pry-byebug"
require 'natto'
require 'active_support'
require 'active_support/core_ext'
class Parser
URL = 'http://negineesan.hatenablog.com'
@reizist
reizist / gist:b1a07d6326c48b5ecfaa9aec62182188
Created October 19, 2017 04:18
difference of presto launching log between local and emr
/local.txt
+++ b/emr.txt
-INFO main Bootstrap PROPERTY DEFAULT RUNTIME DESCRIPTION
+INFO main Bootstrap PROPERTY DEFAULT RUNTIME DESCRIPTION
-INFO main Bootstrap query-manager.initialization-required-workers 1 1 Minimum number of workers that must be available before the cluster will accept queries
-INFO main Bootstrap query-manager.initialization-timeout 5.00m 5.00m After this time, the cluster will accept queries even if the minimum required workers are not available
-INFO main Bootstrap query.max-history 100
@reizist
reizist / gist:d943cd54dee635213ad7d791aedf31cc
Created October 19, 2017 04:19
presto launching log on emr
INFO main io.airlift.log.Logging Disabling stderr output
INFO main Bootstrap PROPERTY DEFAULT RUNTIME DESCRIPTION
INFO main Bootstrap discovery-server.enabled false true
INFO main Bootstrap event.max-output-stage-size 16MB 16MB
INFO main Bootstrap query.client.timeout 5.00m 5.00m
INFO main Bootstrap query.initial-hash-partitions 100 100
INFO main Bootstrap query.max-concurrent-queries 1000 1000
INFO main Bootstrap query.max-history 100 4
[hadoop@ip-172-31-21-25 ~]$ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent3.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1109 100 1109 0 0 2215 0 --:--:-- --:--:-- --:--:-- 2218
==============================
td-agent Installation Script
==============================
This script requires superuser access to install rpm packages.
You will be prompted for your password by sudo.
Loaded plugins: priorities, update-motd, upgrade-helper
@reizist
reizist / nginx.conf
Created April 5, 2018 09:11
社内イスコン
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
# error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
@reizist
reizist / my.cnf
Created April 5, 2018 09:12
社内イスコン
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
character-set-server=utf8mb4
@reizist
reizist / 00_timeline.md
Last active September 16, 2018 02:03 — forked from south37/00_timeline.md
ISUCON Cheat Sheet