jquery-ui のビルドには node と java が必要です。 node は nodenv を用いてインストールします。 java は brew でインストールするのですが容易にバージョン切り替えできるようにしておいた方が良いと思うので jenv もインストールして java のバージョンを切り替えられるようにします。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port = 10051 | |
s = Zabbix::Sender.new 'zabbix-server', port | |
pp s.send('host', 'key', 'value') | |
# => {"response"=>"success", | |
# "info"=>"Processed 1 Failed 0 Total 1 Seconds spent 0.000042"} | |
pp s.to('host') { | |
send 'key', 'value' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 合計を計算する Iteratee (初期値は 0) | |
val initialValue: Int = 0 | |
val sumIteratee: Iteratee[Int, Int] = Iteratee.fold(initialValue) { (total, e) => total + e } | |
// 1, 234, 455, 987 を要素にもつ Enumerator | |
val intEnumerator1: Enumerator[Int] = Enumerator(1, 234, 455, 987) | |
// intEnumerator1 の合計を計算する | |
val futureTotal1: Future[Int] = intEnumerator1.run(sumIteratee) | |
val total1: Int = Await.result(futureTotal1, Duration.Inf) | |
println("total=" + total1.toString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 外部プログラムを非同期実行する場合、以下の様な方法で実行する場合が多いと思います。 | |
require "open3" | |
stdin, stdout, stderr = Open3.popen3(cmd) | |
# cmd の実行に時間がかかる場合、stdin, stdout, stderr が GC により閉じられる確率が高くなります。 | |
# GC により閉じられた stderr に cmd が書き込むと EPIPE 例外が発生し、cmd が異常終了します。 | |
# そこで、stdin, stdout, stderr が不要な場合は閉じておくほうがいいです。 | |
require "open3" | |
Open3.popen3("#{cmd} > /dev/null 2>&1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails Console で次のコマンドを試す | |
```ruby | |
very_complicated_post = { | |
"item" => { | |
"point"=>{ | |
"loc"=>{ | |
"lng"=>"138.08578491210937", | |
"lat"=>"36.24584590837756"}, | |
"zoom_level"=>"10" } } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port = ENV.fetch('port', 3000).to_i | |
SITE_ALLOWED = begin | |
fields = [] | |
# 基本情報 | |
fields += %w[_id id name host domains subdir parent_id domains_with_subdir group_ids partner_site_ | |
ids] | |
# ページ設定 | |
fields += %w[auto_keywords keywords auto_description max_name_length] | |
# モバイル設定 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
port=3000 | |
bundle exec rake db:drop | |
rm -rf private public | |
git checkout -- private public | |
bundle exec rake db:create_indexes | |
bundle exec rake ss:create_site data="{ name: '自治体サンプル', host: 'www', domains: 'www.example.jp:$port', mypage_domain: 'localhost:$port', map_api: 'openlayers' }" | |
bundle exec rake ss:create_site data="{ name: '企業サンプル', host: 'company', domains: 'company.example.jp:$port', mypage_domain: 'localhost:$port', map_api: 'openlayers' }" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 少し凝った zshrc | |
# License : MIT | |
# http://mollifier.mit-license.org/ | |
######################################## | |
# 環境変数 | |
#export LANG=ja_JP.UTF-8 | |
#export PATH="/usr/local/opt/imagemagick@6/bin:$PATH" | |
#export PATH="/usr/local/opt/mongodb-community@4.2/bin:$PATH" | |
#export PATH="/usr/local/sbin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
以下のコマンドを実行した後で bundle install を実行する | |
bundle config build.debase --with-cflags="-Wno-error=implicit-function-declaration" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew doctor で sudo xcode-select --install を実行しろと表示され実行するものの、また sudo xcode-select --install を実行しろと言われる場合: | |
次のコマンドを実行する | |
xcodebuild -runFirstLaunch |
OlderNewer