Skip to content

Instantly share code, notes, and snippets.

@s9011514
s9011514 / step1.php
Created April 26, 2013 14:35
[教學]Google+ 留言框整合到 WordPress 網站中 。 http://sofree.cc/wordpress-google-plus-comments/
<?php comments_template('', true); ?>
@s9011514
s9011514 / step1.html
Last active January 19, 2022 05:08
GitHub Gist 在部落格、網頁中內嵌入高亮程式碼 http://sofree.cc/github-gist/
<script src="https://gist.github.com/5467780.js"></script>
@s9011514
s9011514 / step1.css
Created April 28, 2013 11:36
[CSS]如何去除圖片超連結的藍色外框? http://sofree.cc/css-img-border/
img {
border: 0px
}
@s9011514
s9011514 / step1.html
Created April 28, 2013 11:42
使用jQuery和CSS去除超連結虛線 http://sofree.cc/jquery-css-outline/
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
@s9011514
s9011514 / step1.html
Created April 29, 2013 06:38
在側邊欄加個浮動Facebook粉絲框 http://sofree.cc/sliding-fb-box/
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
@s9011514
s9011514 / step1.html
Last active December 17, 2015 04:49
一鍵儲存檔案到 Google Drive 雲端硬碟 http://sofree.cc/save-files-to-google-drive/
<script src="https://apis.google.com/js/plusone.js"></script>
<div class="g-savetodrive" data-filename="檔案名稱" data-sitename="網站名稱" data-src="檔案路徑">
</div>
@s9011514
s9011514 / remove-iframe.html
Created April 13, 2014 16:15
[教學]如何解決網站被7headlines的iframe蓋台? http://sofree.cc/remove-iframe/
<script>
//<![CDATA[
if (top.location != location ) {
top.location.href = location.href;
}
//]]>
</script>
@s9011514
s9011514 / php-mail.php
Created September 14, 2014 07:13
[PHP]使用Mail函式透過SMTP發信
<?php
$to =" yourmail@your.com "; //收件者
$subject = "test"; //信件標題
$msg = "smtp發信測試";//信件內容
$headers = "From: admin@your.com"; //寄件者
if(mail("$to", "$subject", "$msg", "$headers")):
echo "信件已經發送成功。";//寄信成功就會顯示的提示訊息
else:
echo "信件發送失敗!";//寄信失敗顯示的錯誤訊息
@s9011514
s9011514 / robots.txt
Created July 29, 2015 05:39
解決Googlebot 無法存取網站上的CSS和JS檔案
#Googlebot
User-agent: Googlebot
Allow: *.css
Allow: *.js
# Other bot spider
User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/
<?php
/**
功能:檔案避免中文檔名
**/
function achang_chang_filename_to_date($filename) {
$info = pathinfo($filename);
$ext = empty($info['extension']) ? '' : '.' . $info['extension'];
$name = basename($filename, $ext);
if(!is_numeric($name)){