Skip to content

Instantly share code, notes, and snippets.

先紀錄一些簡單的背景:

什麼是 Open Graph

現在越來越多的App, 或是網路應用都會開始使用Facebook來當做建立社群的媒介,所以Facebook後來推出了Open Graph,Open Graph最主要的目的就是:

Telling Stories with Open Graph

根據Open Graph Overview上面所寫,利用Open Graph可以將目前的應用可以更深度的整合Facebook,加強使用體驗,詳細的敘述就請大家自起看內文了。

How Open Graph Works

首先Facebook有提供SDKs for iOS, Android, and the web. 然後透過Facebook登入App。

然後Open Graph主要由四個元素組成:app, actor, action, object 而倒數的三個元素,可以視為英文基本句型:主詞 + 動詞 + 受詞,文件中以這樣的句子為例子:

# ~/.irbrc
# Requires the following gems: wirble, hirb
#
# Hirb: http://tagaholic.me/hirb/doc/index.html
# Wirble: http://pablotron.org/software/wirble/
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
@hechien
hechien / gist:6673200
Created September 23, 2013 16:32 — forked from xdite/gist:6672847

Maitainable Rails View

寫出容易維護的純 Ruby / Rails code 門檻並不高。但開發網站過程中,最令人頭疼的是,當程式碼牽扯到 UI 層面,許多事情就亂了套。這個 talk 會分享許多實務上如何設計維護性高的 View 的最佳實踐。

不容易維護的 view code 的特徵

  • 重複
  • 邏輯
  • 不容易除錯
.DS_Store

開 Project 流程

使用 Bootstrappers 產生 project

bootstrappers demo
cd demo
git init
git add .
git commit -m "init project" 
#include<iostream.h>
struct Node{
int data;
Node* next;
};
Node* next(Node* _node){
if (_node == NULL) return NULL;
_node = _node->next;
#include<iostream.h>
struct Node{
int data;
Node* next;
};
int main(){
@hechien
hechien / xd_comment.rb
Created August 28, 2012 17:39 — forked from linyiru/gist:3501122
config/initializers/carrierwave.rb
config.fog_host = lambda do
lambda do |file|
host_number = file.path.sum % 4
"//cdn%d.icook.tw" % host_number
end
end