2013年2月16日土曜日

meteor触ってみた

実は前々から気になっていたmeteorというWebフレームワークを、とりあえずサンプルを動かすまでやってみました。
先人に感謝しつつ、私のAirちゃんで動かしました。

セットアップ

まずはmeteorをインストールします。とはいえ、たったこれだけ。

$curl install.meteor.com | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5239  100  5239    0     0   8374      0 --:--:-- --:--:-- --:--:-- 12327
Installing Meteor to /usr/local/meteor

The install script needs to change the permissions on /usr/local so that
administrators can write to it. This may prompt for your password.

Password:
... downloading
######################################################################## 100.0%

Meteor installed! To get started fast:

  $ meteor create ~/my_cool_app
  $ cd ~/my_cool_app
  $ meteor

Or see the docs at:

  docs.meteor.com

これで/usr/local/bin/meteorコマンドが使えるようになったので早速。

$ meteor --help
Usage: meteor [--version] [--help]  []

With no arguments, 'meteor' runs the project in the current
directory in local development mode. You can run it from the root
directory of the project or from any subdirectory.

Use 'meteor create ' to create a new Meteor project.

Commands:
   run        [default] Run this project in local development mode
   create     Create a new project
   update     Upgrade to the latest version of Meteor
   add        Add a package to this project
   remove     Remove a package from this project
   list       List available packages
   bundle     Pack this project up into a tarball
   mongo      Connect to the Mongo database for the specified site
   deploy     Deploy this project to Meteor
   logs       Show logs for specified site
   reset      Reset the project state. Erases the local database.

See 'meteor help ' for details on a command.

サンプル

それではサンプルを動かしてみます。

$ meteor create --example leaderboard
leaderboard: created.

To run your new app:
   cd leaderboard
   meteor

プロジェクトを作成して、

$ cd leaderboard/
$ meteor
[[[[[ ~/workspace/test/meteor/leaderboard ]]]]]

Running on: http://localhost:3000/

これで起動します。さっそく表示されているURLにアクセスしてみます。


まあサンプルなのであんまり意味あるアプリじゃありませんが。

ソースコード

ソースコードはGitHubに上げました。


これから色々いじくってみたいと思います!

2013年2月2日土曜日

GitHub導入

一応私もプログラム書く人間なので(笑)、バージョン管理ツールは必須だよなということで、GitHubをセットアップしました。
実はアカウント自体は数年前に作成していたのですが、有効活用することもなく現在に至っていました…。
今年から色々活動していこうという訳で、GitHubをどんどん使っていこうと思います!ついでにアカウントをFreeからMicroにUpgradeもしました。
やっぱりprivate repositoryを使いたくなることってありますからねー。まあ必要経費ということで。

GitHubは本職の会社でも使っているのですが便利ですよね。gistとかpull requestとか。wikiもついてますし。
それにしてもGUIツールが作られていたことに驚き。pub keyの設定も不要で楽チンですね。
http://mac.github.com/

まあエンジニアにはコマンドの方がちゃちゃっとやれて便利ですが(笑)