Skip to content

Instantly share code, notes, and snippets.

Avatar

Masakazu Matsushita matsukaz

View GitHub Profile
@matsukaz
matsukaz / Good Developer Experience.md
Last active Mar 4, 2021
The only way how to have happy & productive developers [DevFest CZ 2018] の要約メモ
View Good Developer Experience.md
@matsukaz
matsukaz / isucon_howto.md
Created Sep 19, 2018
ISUCON当日の進め方
View isucon_howto.md

進め方

  • こまめに話しながらコミュニケーションを取る
  • やった作業はSlackで共有
  • 全体構成など整理しやすいように、ホワイトボードを活用

当日やること

課題の理解

@matsukaz
matsukaz / 01.README.md
Last active Sep 27, 2021
Find a geolocation of an IP address in BigQuery
View 01.README.md

This query is to find geolocation of an IP address including latitude, longitude, city and country.

Legacy SQL doesn't support range conditions such as BETWEEN when using JOIN, so we need to filter data by WHERE. This means if IP address does not match any of the data inside geolite_city_bq_b2b, records will not be able to receive.

Use Standard SQL if you want to receive records no matter you succeed to find geolocation or not.

Please refer to the following post for more detail.

https://cloudplatform.googleblog.com/2014/03/geoip-geolocation-with-google-bigquery.html

@matsukaz
matsukaz / application.rb
Last active Oct 20, 2021
Rails connection management to handle Amazon Aurora's failover
View application.rb
module xxx
class Application < Rails::Application
#(中略)
config.middleware.swap ActiveRecord::ConnectionAdapters::ConnectionManagement,
'ActiveRecord::ConnectionAdapters::ReconnectOnErrorManagement'
end
end
View gist:b2871dc191f418c813886d9cfde01d3d
### Keybase proof
I hereby claim:
* I am matsukaz on github.
* I am matsukaz (https://keybase.io/matsukaz) on keybase.
* I have a public key ASCBEp_cERws8a9bgyJk6TWOlgQlpLEPq8atcv--G9Ynwwo
To claim this, I am signing this object:
View s3-bucket-listing.js
// see) https://github.com/rufuspollock/s3-bucket-listing
if (typeof S3BL_IGNORE_PATH == 'undefined' || S3BL_IGNORE_PATH!=true) {
var S3BL_IGNORE_PATH = false;
}
if (typeof BUCKET_URL == 'undefined') {
var BUCKET_URL = location.protocol + '//' + location.hostname;
}
@matsukaz
matsukaz / annotations.rb
Last active Aug 10, 2021
Rubyでアノテーションを実装 / Implementing java-like annotations in ruby
View annotations.rb
module Annotations
@@__last_annotation__ = nil
def annotations(meth=nil)
return @@__annotations__[meth] if meth
@@__annotations__
end
private
@matsukaz
matsukaz / gist:e5876ca34716794c0dfb
Created Mar 22, 2016
xcodeのバージョンアップ時にプラグインを再度有効化する方法
View gist:e5876ca34716794c0dfb
XCODE_UUID=`defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID`
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist | xargs -IFILE defaults write FILE DVTPlugInCompatibilityUUIDs -array-add ${XCODE_UUID}
@matsukaz
matsukaz / .gitignore
Last active Sep 5, 2018 — forked from BennettSmith/.gitignore
Google Protobuf v2.6.0 Build Script for iOS
View .gitignore
protobuf
protobuf-2.6.0
protobuf-2.6.1
protobuf-master