Friday, December 4, 2015

Monday, February 16, 2015

Add SyntaxHighlighter to Blog Post in One Minute

1. Edit your blog template.

2. Find the
tag.

3. Paste the fragment below before the tag you found above
(NOTE: this is my custom helper and will load js from my github cdn,
 you can modify it to create your own as needed)

4. Save template

Done

(It seems there is an autoloader feature but that page not works well so
I wrote my own.)

References:

My testing files

SyntaxHighlighter-themes

SyntaxHighlighter-configuration

Friday, February 13, 2015

Sunday, September 21, 2014

Ruby on Rails Getting Started


Pre-request

Ruby Getting Started
http://ben-bai.blogspot.tw/2014/09/ruby-getting-started.html

SQLite Getting Started
http://ben-bai.blogspot.tw/2014/09/sqlite-getting-started.html

Note

You can also use rails installer to install ruby, sqlite and rails at once.
see http://railsinstaller.org/en

Simple Note

Follow tutorial
http://guides.rubyonrails.org/getting_started.html

But not works



Follow Installation Instructions at
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
to install Development Kit



Test Development Kit



Install Rails again



Still has some error, but seems rails is installed.

Follow tutorial, type "rails new blog" to create a blog and run server



Hello, Rails!


Ruby Getting Started


Simple Note

Go to http://rubyinstaller.org/downloads/ and
choose latest stable version (1.9.3 for now)
or
check the recommanded version in download page of RoR.
http://rubyonrails.org/download/
I prefer the stable one.

Download it

run installer

follow tutorial to run first gem
http://guides.rubygems.org/make-your-own-gem/#first-gem

testing process and result
https://github.com/benbai123/RubyOnRails/blob/master/Practice/Ruby_Getting_Started/test.png

Full test project at github
https://github.com/benbai123/RubyOnRails/tree/master/Practice/Ruby_Getting_Started

Friday, September 19, 2014

SQLite Getting Started


Simple Note


Go to http://www.sqlite.org/

Go to download page

Download Precompiled Binaries for Windows
(sqlite-shell and sqlite-dll here)

Unzip them into a folder (e.g. C:\programs\sqlite)

Add the folder above into Path (the Environment variable)
or you will need to cd to that folder each time.

Open cmd

Type "sqlite3 test.db"
test.db created

now you can use SQL to access test.db

you can also execute "sqlite3" then choose database with attach command,
e.g. attach "test.db" as test
see http://stackoverflow.com/questions/9057787/opening-database-file-from-within-sqlite-command-line-shell