RequireJS 搭配 CKEditor
網頁編輯器大家推薦的就 CKEditor 或 TinyMCE,兩套各有優缺點,CKEditor 雖然功能最完整,也是最肥了,雖然官網可以自己挑選 plugin 來簡化肥肥的 source code。如果是單純用在後台管理,我還是推薦 CKEditor,給前端使用者的話,就推薦 TinyMCE 了,畢竟前台還是要以輕量為主。
Continue reading “RequireJS 搭配 CKEditor”
介紹一堆美食日記,生活日記,電腦筆記
記的之前 evenwu 為了找尋外包 CSS 人才,出了一份考題,有提供上機考,真是佛心來的,還給用 Inspector 或上網。其中一題就是
第二題、如果一個X元素內的子元素通通 float: left 請問X元素本身會有什麼狀況?如果我要在X元素內下背景,卻沒有顯示,請問如何解決?
解決方式就是實作本身 clearfix
,或者是在元素後加上 clear: both
的標籤,大概就是底下的樣子
如果是要在 container 實作 clearfix,就必須透過 css before
和 after
。
.clearfix { *zoom: 1; } .clearfix:before, .clearfix:after { content: ""; display: table; line-height: 0; } .clearfix:after { clear: both; }
SASS 版本
.clearfix { *zoom: 1; &:before, &:after { display: table; content: ""; line-height: 0; } &:after { clear: both; } }
這樣只要在任何 element 加上 clearfix css 就可以了,支援瀏覽器版版: Firefox 3.5+, Safari 4+, Chrome, Opera 9+, IE 6+
RewriteEngine on RewriteBase / RewriteCond $1 !^(index\.php|images|robots\.txt|$) RewriteRule ^(.*)$ index.php/$1 [L,QSA]在 Nginx 內只要透過 try_files 即可
location / { try_files $uri $uri/ /index.php }正常來說 Laravel 直接用上面的設定即可,但是我發現在 $_GET 這全域變數會拿到空值,解法也很簡單,在 Nginx 將 query string 變數帶到 index.php 後面即可
location / { try_files $uri $uri/ /index.php?$query_string; }
home_mailbox = Mailbox此設定會將原本放在 /var/spool/mail/ 目錄下的檔案都換成 /home/appleboy/Mailbox,注意在 bashrc 請加入
$ export MAIL=~/Mailbox
home_mailbox = Maildir/接著取消 MAIL 變數
$ unset MAIL最後寫入新的變數內容
$ export MAILDIR=~/Maildir重新啟動 postfix
$ /etc/init.d/postfix restart寄封信測試看看目錄是否有建立:
$ echo "This is the message body" | mail -s "This is the subject" root@localhost這時你會發現在自己的 Home 目錄底下多出了 Maildir/tmp, Maildir/cur, Maildir/new 等三個目錄,代表設定成功了