熱門文章

2015年7月31日 星期五

「澳洲」網站


http://blog.ozbargain.com.au

[澳洲]「澳洲生活技巧」Raincheck 延期優惠券

當你去woolworths ,Coles ...等賣場,去購買當期的DM特價品時,有時候應為太過搶手而缺貨。可以向櫃檯索取Raincheck Voucher,在該券寫上商品、價格及數量,即可在到貨時以當時優惠價格購得該商品。如果很想要買不要一看到架上空了就空收而歸了喔,可以先詢問是否有庫存,再不然就索取raincheck吧!!有效期限為12個月。
What is a Raincheck?
If Advertised Stock is unavailable for you to purchase from your Woolworths Supermarket, we will cheerfully provide you with a Raincheck so you can purchase that Product with a Raincheck Voucher at the same price when it becomes available unless an Exclusion applies.
What are the Exclusions?
A Raincheck will not be offered on Advertised Stock where it is specified *While stocks last in any relevant advertising material. 
If this is the case, please see our friendly staff at the service desk who can find out if the Product is available from another local Woolworths Supermarket.  If not, the service team may be able to assist you to identify a suitable alternative.
What Advertised Stock is included for Raincheck purposes?
Advertised Stock refers to any Product advertised for sale in catalogue, press, television or which is on promotion in-store at your Woolworths Supermarket but does not include Woolworths Online.
How do I obtain a Raincheck Voucher?
See our friendly staff at the service desk who will confirm that the Product is unavailable and that a Raincheck will be offered. If the Product is unavailable, the service desk staff will provide you with a Raincheck Voucher.
Where can I redeem a Raincheck Voucher?
Raincheck Vouchers can be redeemed at any Woolworths Supermarket where the Product is ranged.
How long is a Raincheck Voucher valid for?
Raincheck Vouchers are valid for 12 months from the date of issue.

2015年7月30日 星期四

Try Ruby Lv6 ch2

自定義Ruby Hash 
教學:https://gradyli.wordpress.com/2007/11/24/hash/


def load_­comics(pat­h)  //定義method load_­comics 含一個導入函數path
.. comics = {} //宣告一個空 Ruby Hash :comics
.. File.forea­ch(path) do |line­|  //開啟一個檔案,且一段一個區間,將每line
.... name,url=l­ine.split(­':')  //的文字,從‘:’分兩段,儲存於name與url
.... comics[nam­e]=url.str­ip //配對 name 與 url 至Hash
  • //strip -- This quick method removes extra spaces around the url. Just in case.
.... end

2015年7月19日 星期日

[GitHub]生成/上傳SSH keys



Step 1: Check for SSH keys

First, we need to check for existing SSH keys on your computer. Open Terminal and enter:
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
Check the directory listing to see if you already have a public SSH key. By default, the filenames of the public keys are one of the following:
  • id_dsa.pub
  • id_ecdsa.pub
  • id_ed25519.pub
  • id_rsa.pub
If you see an existing public and private key pair listed (for example id_rsa.pub and id_rsa) that you would like to use to connect to GitHub, you can skip Step 2 and go straight to Step 3.
Tip: If you receive an error that ~/.ssh doesn't exist, don't worry! We'll create it in Step 2.


Step 2: Generate a new SSH key

  1. With Terminal still open, copy and paste the text below. Make sure you substitute in your GitHub email address.
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    # Creates a new ssh key, using the provided email as a label
    # Generating public/private rsa key pair.
    
  2. We strongly suggest keeping the default settings as they are, so when you're prompted to "Enter a file in which to save the key", just press Enter to continue.
    # Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
    
  3. You'll be asked to enter a passphrase.
    # Enter passphrase (empty for no passphrase): [Type a passphrase]
    # Enter same passphrase again: [Type passphrase again]
    
    Tip: We strongly recommend a very good, secure passphrase. For more information, see "Working with SSH key passphrases".
  4. After you enter a passphrase, you'll be given the fingerprint, or id, of your SSH key. It will look something like this:
    # Your identification has been saved in /Users/you/.ssh/id_rsa.
    # Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
    # The key fingerprint is:
    # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com# 

Step 3: Add your key to the ssh-agent

To configure the ssh-agent program to use your SSH key:
  1. Ensure ssh-agent is enabled:
    # start the ssh-agent in the background
    eval "$(ssh-agent -s)"
    # Agent pid 59566
    
  2. Add your SSH key to the ssh-agent:
    ssh-add ~/.ssh/id_rsa
    

Tip: If you didn't generate a new SSH key in Step 2, and used an existing SSH key instead, you will need to replace id_rsain the above command with the name of your existing private key file.


Step 4: Add your SSH key to your account

To configure your GitHub account to use your SSH key:
Copy the SSH key to your clipboard. Keep in mind that your key may also be named id_dsa.pubid_ecdsa.pub or id_ed25519.pub, in which case you must change the filename as follows:
pbcopy < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard
Warning: It's important to copy the key exactly without adding newlines or whitespace.
Add the copied key to GitHub:

  1. Settings icon in the user barIn the top right corner of any page, click your profile photo, then click Settings.
  2. SSH keysIn the user settings sidebar, click SSH keys.
  3. SSH Key buttonClick Add SSH key.
  4. In the Title field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
  5. The key fieldPaste your key into the "Key" field.
  6. The Add key buttonClick Add key.
  7. Confirm the action by entering your GitHub password.


Step 5: Test the connection

To make sure everything is working, you'll now try to SSH into GitHub. When you do this, you will be asked to authenticate this action using your password, which is the SSH key passphrase you created earlier.
  1. Open Terminal and enter:
    ssh -T git@github.com
    # Attempts to ssh to GitHub
    
  2. You may see this warning:
    # The authenticity of host 'github.com (207.97.227.239)' can't be established.
    # RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
    # Are you sure you want to continue connecting (yes/no)?
    
    Verify the fingerprint in the message you see matches the following message, then type yes:
    # Hi username! You've successfully authenticated, but GitHub does not
    # provide shell access.
    
  3. If the username in the message is yours, you've successfully set up your SSH key!
    If you receive a message about "access denied," you can read these instructions for diagnosing the issue.
    If you're switching from HTTPS to SSH, you'll now need to update your remote repository URLs. For more information, see Changing a remote's URL.






https://help.github.com/articles/generating-ssh-keys/

2015年7月18日 星期六

[OS X]安裝Ruby On Rails

Setup Ruby On Rails on
Mac OS X 10.10 Yosemite


首先,OS X 的使用者使用 Homebrew 作為套件管理工具。
First, we need to install Homebrew. Homebrew allows us to install and compile software packages easily from source.
Homebrew comes with a very simple install script. When it asks you to install XCode CommandLine Tools, say yes.
Open Terminal and run the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
出現以上畫面,按[enter]鍵繼續。

安裝中。。。

完成第一步驟,安裝Homebrew。

Choose the version of Ruby you want to install:
Now that we have Homebrew installed, we can use it to install Ruby.
We're going to use rbenv to install and manage our Ruby versions.
To do this, run the following commands in your Terminal:
brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

# Install Ruby
rbenv install 2.2.2
rbenv global 2.2.2
ruby -v

install rbenv ruby-build
done.
step2-2
rbenv install 2.2.2


使用 ruby -v 查詢結果還是2.0
試試重開




 yes!2.2

We'll be using Git for our version control system so we're going to set it up to match our Github account. If you don't already have a Github account, make sure to register. It will come in handy for the future.
Replace the example name and email address in the following steps with the ones you used for your Github account.
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
ssh-keygen -t rsa -C "YOUR@EMAIL.com"
The next step is to take the newly generated SSH key and add it to your Github account. You want to copy and paste the output of the following command and paste it here.
cat ~/.ssh/id_rsa.pub
Once you've done this, you can check and see if it worked:
ssh -T git@github.com
You should get a message like this: 
Hi excid3! You've successfully authenticated, but GitHub does not provide shell access.



Your identification has been saved in /Users/QJpioneer/.ssh/id_rsa.
Your public key has been saved in /Users/QJpioneer/.ssh/id_rsa.pub.
The key fingerprint is:
25:00:95:e8:ba:a2:4a:ed:91:26:41:37:cb:32:f3:f3 qjpioneer@gmail.com
The key's randomart image is:
+--[ RSA 4096]----+
|    .+o.         |
|    . ..         |
| . +    . .      |
|. o +    o       |
| = +    S        |
|  O .            |
| o O             |
|o = +            |
|=. . E           |
+-----------------+


https://gorails.com/setup/osx/10.10-yosemite
https://ihower.tw/rails4/installation.html