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 Erlcloudsandbox do | |
# Elixir で使いやすいように Record を利用するための準備 | |
# http://elixir-lang.org/docs/v1.0/elixir/Record.html | |
# に書いてあるように Record は単に先頭の要素が Atom である Tuple | |
# 単に Erlang のレコードを使うだけなら,Elixir で Record 宣言する必要はない. | |
# | |
# ただ,Elixir で Record を宣言しておくと, | |
# http://elixir-lang.org/docs/v1.0/elixir/Record.html#defrecord/3 | |
# に書いてあるような Elixir から名前つきアクセスが便利にできるようになる. | |
require Record |
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
#!/usr/bin/ruby | |
require 'uri' | |
require 'net/http' | |
require 'json' | |
require 'date' | |
require 'twitter' | |
begin | |
CONSUMER_KEY = 'xxxxx' |
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
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
#!/bin/sh | |
# This program has two feature. | |
# | |
# 1. Create a disk image on RAM. | |
# 2. Mount that disk image. | |
# | |
# Usage: | |
# $0 <dir> <size> <volume> | |
# |
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
(defun anything-c-sources-git-project-for (pwd) | |
(loop for elt in | |
'(("Modified files (%s)" . "--modified") | |
("Untracked files (%s)" . "--others --exclude-standard") | |
("All controlled files in this project (%s)" . "")) | |
collect | |
`((name . ,(format (car elt) pwd)) | |
(init . (lambda () | |
(unless (and ,(string= (cdr elt) "") ;update candidate buffer every time except for that of all project files | |
(anything-candidate-buffer)) |