[轉]database.yml &, <<, *

http://stackoverflow.com/questions/6651275/what-do-the-mean-in-this-database-yml-file The & marks an alias for the node (in your example &defaultaliases the development node as “default”) references the aliased node with the name “default”. «: inserts the content of that node. test: &test «: *default default_env: «: *production

2014-08-24 · 1 min · 40 words · Me

sinatra mobile app cordova -- just for note

https://gauntface.com/blog/2014/02/05/cordova-web-best-practices-v2-0 http://spiritmachineblog.tumblr.com/post/41432461669/a-simple-openlayers-app-with-yeoman-sinatra-mongodb HTML5 Boilerplate Sass with Compass Modernizr http://thibaultdenizet.com/tutorial/cors-with-angular-js-and-sinatra/ 簡單說:發現現在要走moble app,要有yoeman的產生的網頁檔,或是 走Angular.js, jquerymobile, bootstrap三個來做。 新增、修改、刪除 走Restful,看上面範例。這樣產出來的網頁能適用 手機和平板。 但要把 程式轉成可以用cordova,要用Compass之類的,把所有的js, css, html5 三個檔。 http://vimeo.com/35998909 https://www.youtube.com/watch?v=e4yUTkva_FM https://www.youtube.com/watch?v=wVntVkRLR3M bit.ly/zen-ng-phonegap Angular UI部份 這看起來有點像官方Angular原生 http://angular-ui.github.io/bootstrap/ 這是另一個整合好Bootstrap and Angular JS http://mobileangularui.com/ 這是angular+ionic http://ionicframework.com/ http://ionicframework.com/docs/overview/#download http://ionicframework.com/docs/components/ ================== **SASS (Sass) **require jquery.mobile 21:13 http://demos.jquerymobile.com/1.2.0/ http://demos.jquerymobile.com/1.2.0/docs/pages/page-anatomy.html css style => data-role %meta{name: ‘viewport’, content: ‘width=device-width, initial-scal-1’) http://demos.jquerymobile.com/1.2.0/docs/lists/lists-collapsible.html **haml http://html2haml.heroku.com/ ===== phonegap 41:01 開一個android專案,但只是把網頁load進來…..真是簡單 www/index.html script include: phonegap-1.3.0.js onBodyLoad(){ document.addEventListener(“dviceready”, onDeviceready, false); windows.location.href = ‘http://localhost:3000’ } http://mobileangularui.com/demo/#/ http://ionicframework.com/ ============ https://www.youtube.com/watch?v=sCnGSOaaZFo http://jaydata.org/blog/angularjs-with-jaydata%E2%80%93-the-todo-example-with-the-itemstore-api ...

2014-08-24 · 2 min · 280 words · Me

yaml

現在新版的ruby 2.0的ruby,需要rquire ‘yaml’嗎? ==== http://reyesyang.info/articles/10 注意在YAML中,字串不一定要用双引号标示。另外,在缩排中空白字符的数目并不是非常重要,只要相同阶层的元素左侧对齐就可以了(不过不能使用TAB字符)。

2014-08-23 · 1 min · 6 words · Me

haml Sass CoffeeScript IaaS Paas SaaS

IaaS 像主機 Paas 設好環境 SaaS 軟體裝好 http://blog.frost.tw/posts/2014/01/15/getting-started-paas-1 haml 處理html Sass 處理css CoffeeScript 處理javascript

2014-08-22 · 1 min · 13 words · Me

ruby sinatra activerecord

如果是用 require “sinatra” require “active_record” require ‘mysql2’ 用底下設定比較快 ActiveRecord::Base.configurations = YAML.load_file(‘database.yml’) ActiveRecord::Base.establish_connection(‘production’) 用 require “sqlite3” ActiveRecord::Base.establish_connection( :adapter => ‘sqlite3’, :database => ‘blog.db’ ) 注意:database.yml 要像底下,關健字不一樣,就不能用 production: adapter: mysql2 database: host: localhost username: password:

2014-08-21 · 1 min · 33 words · Me