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
def make love | |
puts "I've made #{love} today" | |
end | |
def you want | |
want | |
end | |
love, want = "love", true |
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 'gmail' | |
gmail = Gmail.new("[email protected]", "password") | |
puts gmail.inbox.count # 印出目前信箱裡的總數量 | |
puts gmail.inbox.count(:unread) # 印出目前信箱裡的未讀的數量 |
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
{ | |
"literate-haskell"=>"Literate Haskell", | |
"smarty"=>"Smarty", | |
"gettext"=>"Gettext catalogs", | |
"gcc-messages"=>"GCC Messages", | |
"html+django"=>"Django / Jinja Templates", | |
"csv"=>"CSV", | |
"sourceslist"=>"sources.list", | |
"pycon"=>"Python Console Sessions", | |
"jsp"=>"JSP", |
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
Dear all, | |
目前我在幫奇摩Yahoo招募正職軟體工程師,新鮮人可!(正職) | |
職缺:Yahoo的網頁前端 /後端軟體工程師(依背景與專業分發) | |
學歷:大學以上畢業、資訊相關背景 | |
工作地點: 台北南港軟體園區 | |
Requirement: | |
1.熟悉PHP/ JAVA / JavaScript /AJAX | |
2.熟悉CSS/ HTML |
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
Titanium.UI.setBackgroundColor('#fff'); | |
var tabGroup = Titanium.UI.createTabGroup(); | |
var my_window = Titanium.UI.createWindow({ | |
title:'This is my window', | |
url:'views/my_window.js' | |
}); | |
var my_tab = Titanium.UI.createTab({ | |
title:"Main Window", |
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
val = [0,1] | |
10.times do |n| | |
puts val[n] ||= val[n-1] + val[n-2] | |
end |
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
// AS2常見的迴圈插旗子法 | |
for (var i = 0; i < 10; i++) | |
{ | |
this["mc_" + i].i = i; | |
this["mc_" + i].onRelease = function(){ | |
trace(this.i); | |
} | |
} |
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
public function afterRefreshItem($itemKey, &$iterator) | |
{ | |
$itemData = $iterator[$itemKey]; | |
$iterator[$itemKey]['subtotal'] = $itemData['quantity'] * $itemData['price']; | |
$this->_total += $iterator[$itemKey]['subtotal']; | |
} |
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
class Hello | |
constructor: (@words) -> | |
greeting: -> | |
alert @words | |
new Hello("CoffeeScript").greeting() |
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
padding_left = (str, len) -> | |
str = "#{str}" | |
str = "0#{str}" while str.length < len | |
str | |
padding_right = (str, len) -> | |
str = "#{str}" | |
str = "#{str}0" while str.length < len | |
str |
OlderNewer