This file contains hidden or 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
| defmodule Fibcalc do | |
| def calc_fibs(list) do | |
| # 今回「プロセスを生成して,生成したプロセスの中で計算して,その結果を送ってもらう」という処理をこれから書く. | |
| # 送ってもらう先は自分になるので,自分のpidを覚えておく. | |
| me = self | |
| # ```[1,2,3] |> Enum.map(fn (elem) -> elem + 1 end)``` | |
| # は | |
| # ```Enum.map([1,2,3], fn (elem) -> elem + 1 end)``` | |
| # と同じ.|>の左側の結果が,|>の右側の式の第一引数になる. |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
| <title>jQuery test</title> | |
| <style type="text/css"> | |
| p { background-color: #afc; padding: .5em } | |
| </style> | |
| </head> |
This file contains hidden or 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
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "hideo" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| config.vm.network "forwarded_port", guest: 8080, host: 18080 | |
| config.vm.provision "shell", inline: <<__EOS__ | |
| wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - | |
| sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' | |
| sudo apt-get update |
This file contains hidden or 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
| 〜 | |
| ‖ | |
| − | |
| ¢ | |
| £ | |
| ¬ |
This file contains hidden or 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 'json' | |
| obj = { | |
| foo: 'bar', | |
| hoge: [ | |
| 'fuga', | |
| { | |
| one: 1, | |
| two: 2 | |
| } |
This file contains hidden or 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
| since: 07-30 | |
| favorite_count top 10 | |
| 35 , 10-04 20:53 , 【札幌】北海道教育大・MF上原、来季加入へ http://t.co/2fhQcutl5E , https://twitter.com/consadole/status/386096635412885505 | |
| 30 , 10-04 06:23 , 【札幌】前寛之、トップ昇格!クラブ初の兄弟選手誕生 http://t.co/ROr9qa89bS , https://twitter.com/consadole/status/385877695218720769 | |
| 23 , 11-27 14:08 , 愛媛FC 石井 謙伍 選手 加入決定のお知らせ http://t.co/srSIiWH6Pp , https://twitter.com/consadole/status/405563675055902720 | |
| 16 , 10-07 18:38 , 上原 拓郎 選手(北海道教育大学岩見沢校/コンサドーレ札幌ユース・U-18出身) 2014年シーズン 新加入内定のお知らせ http://t.co/a2m8MioHkZ , https://twitter.com/consadole/status/387149831061262336 | |
| 14 , 10-05 06:23 , 【札幌】岩見沢教育大・MF上原獲得「育った札幌で」 http://t.co/jb5JLD1aaO , https://twitter.com/consadole/status/386240084896268288 | |
| 13 , 08-13 11:23 , 札幌上里、J1完全移籍の打診断り残留へ http://t.co/aUN6DTUiuF , https://twitter.com/consadole/status/367109014775021568 | |
| 13 , 11-24 19:53 , コンサドーレファミリーの皆様へ http://t.co/MoXkwsmjpo , https://twitter.com/consadole/status/404563324886454272 | |
| 11 , 09-25 18:53 , 上里一将 選手からサポーターの皆様へ http://t.co/zd1K5zT3G5 , https://twitter.com/co |
This file contains hidden or 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
| { | |
| "endpoints": [ | |
| { | |
| "name": "/me", | |
| "description": "自分自身の情報にアクセスできます。", | |
| "apis": [ | |
| { | |
| "verb": "GET", | |
| "path": "/me", | |
| "implemented": true, |
This file contains hidden or 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
| # from | |
| # http://pragprog.com/book/elixir/programming-elixir | |
| # 14 Process Overhead | |
| defmodule Chain do | |
| def counter(next_pid) do | |
| # Chain.counter は,何か数値が送られてきたらその数値に1を加えて次のプロセスを呼びだす | |
| # 数値がsendで送られてくるまでは単に待ちつづける | |
| receive do # 3つのプロセスとも,プロセスにむけて数値がsendで送られてくるまでここで止まる |
This file contains hidden or 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 'flickraw' | |
| require 'exifr' | |
| class ConnectionAdapter | |
| def connection | |
| FlickRaw.api_key = "" | |
| FlickRaw.shared_secret = "" | |
| flickr.access_token = "" | |
| flickr.access_secret = "" | |
| flickr |
This file contains hidden or 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
| echo 'install_package "ruby-2.0.0-p0" "http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz#50d307c4dc9297ae59952527be4e755d"' > /usr/local/Cellar/ruby-build/HEAD/share/ruby-build/ruby-2.0.0-p0 | |
| CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-p0 |