Friday, December 4, 2015
Some answer for Front-end-developer-interview-questions
Start to reading Front-end-developer-interview-questions and make some answer, you can take it as reference.
Will add more over time.
Monday, February 16, 2015
Add SyntaxHighlighter to Blog Post in One Minute
1. Edit your blog template.
2. Find the
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
2. Find the
</body>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)
<script type='text/javascript'>
syntaxHighlighterConfig = {
config: {
// required for blog
bloggerMode: true
},
defaults: {
// optional, collapse code block
// collapse: true
},
themes: {
// optional, use other themes
// 'dark' can be any string
// 'shThemeRDark.css' should be the file name
'dark': 'shThemeRDark.css'
}
};
</script>
<script src='//cdn.rawgit.com/benbai123/HTML_CSS_Javascript_practice/2da59146af1a73f8700c33f3562e09c0b2c31ef8/libs_tools/SyntaxHighlighter/helper/shHelper.js' type='text/javascript'></script>
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
Use SyntaxHighlighter with Custom Helper
Simple Note
Use a helper js file to load required js/css files for you.
Samples
testHelper.html
shHelper.js
Use a helper js file to load required js/css files for you.
Samples
testHelper.html
shHelper.js
Thursday, February 12, 2015
Use SyntaxHighlighter to Highlight Code
Simple Note:
Test File:
test.html
Result:
Reference:
http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html
Test File:
test.html
Result:
Reference:
http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html
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
Subscribe to:
Posts (Atom)






