Windows Tips

May 17th, 2012 admin No comments

Convert FAT32 into NTFS

VN:F [1.9.7_1111]
Rating: 10.0/10 (1 vote cast)
Categories: Learnings Tags:

网站常用的一些东西

May 9th, 2012 admin No comments

1. 屏蔽中文浏览器

JS版本:
<script language=”javascript”>
<!–
var t=navigator.userLanguage
if (t==”zh-cn” || t==”zh-tw” || t==”zh-hk” || t==”zh-mo”)
{
location.replace(“http://www.xxxx.cn/”);
}
else
{
location.replace(“http://www.xxx.com/”);
}
–>
</script>

PHP版本
<?php
$b_lang = ”;
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 4);
if (preg_match(“/zh-c/i”, $lang))
$b_lang = ‘sc’;
else if (preg_match(“/zh/i”, $lang))
$b_lang = ‘tc’;
else
$b_lang = ‘ot’;
if ($b_lang == ‘sc’  ||  $b_lang == ‘tc’  ){
echo “<script language=’javascript’>”;
echo ” location=’/welcome.html’;”;
echo “</script>”;
}
?>

2. 屏蔽国家

http://www.ip2location.com/free/visitor-blocker

3. JS Prototype异步加载

<script src=”http://www.bram.us/js/lib/prototype.js” type=”text/javascript”></script>
<script src=”http://www.bram.us/js/bramus/lazierLoad.js” type=”text/javascript”></script>

http://www.bram.us/projects/js_bramus/lazierload/

4.

 

VN:F [1.9.7_1111]
Rating: 10.0/10 (2 votes cast)
Categories: Programming Tags:

一些软件使用的技巧笔记(备忘)

April 11th, 2012 admin No comments

scrapebox: 如何让某一关键字对应某一个网址来发留言?而不是那种,一堆关键字对应一堆url 随机留言?

Names 和 Websites 可以对应的, scrapebox语法:

写在websites里,格式:
http://www.catsite.com {cat|cat food}
http://www.dogsite.com {dog|dog food}

VN:F [1.9.7_1111]
Rating: 10.0/10 (2 votes cast)
Categories: SEO Tags:

淘宝购物小经验

April 9th, 2012 admin No comments

在淘宝购物时,我们一般会先去找到自己要买的产品的分类或者搜索页面,大部分时候我们并不知道哪个最好,而是觉得淘宝上排在前面的,评价最多就是做好的,甚至很多都是直接买拍在第一的那家,因为排第一的评价多,好评也多,最近成交量也是最大。而这样往往不能买到最好最合适的。

为什么?

最近成交量参考意义不大,同一件商品最近成交600与最近成交60其实没什么差别,可以说两家都是正常的信得过的卖家,但是排名上最近成交600会远远超过最近成交60的,而最近成交60的那家卖的一模一样的东西,甚至可能价格还要低些,服务也更好写,只是排在后面没被我们发现而已。

最后总结一个淘宝购物的步骤:

先不看价格和评价等等,甚至不去淘宝,去一些评测的网站确定好自己最想买那款产品型号(不要去淘宝上逛了在确定买哪款,那样会被淘宝的排名误导),确定好买哪款后,再去淘宝上搜索这款具体的产品,选最近有一些交易记录,价格比较低,同时选离自己比较近的卖家购买。

VN:F [1.9.7_1111]
Rating: 10.0/10 (1 vote cast)
Categories: Miscellany Tags:

利用shortcodes pro插件在post中插入一个目录下的任意图片

March 15th, 2012 admin No comments

安装shortcodes pro插件后,新建shortcode,选php,
以下代码是显示某个目录下任意一张图片的代码

<?php
 $imglist='';
 //用$img_folder变量保存图片所在目录,必须用“/”结尾
 $img_folder = "images/";

 mt_srand((double)microtime()*1000);

 //使用目录类
 $imgs = dir($img_folder);

 //检查目录下是否有图片,并生成一个清单
 while ($file = $imgs->read()) {
 if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
 $imglist .= "$file ";

 } closedir($imgs->handle);

 //把清单里的项都放到一个数组里
 $imglist = explode(" ", $imglist);
 $no = sizeof($imglist)-2;

 //生成一个介于0和图片数量之间的随机数
 $random = mt_rand(0, $no);
 $image = $imglist[$random];

//输出结果
 echo '<a href="http://www.zhoushibiao.com"><img width="400" src="'.$img_folder.$image.'" border=0/></a>';
?>

将以上代码<?php ?>去掉,echo替换成return后插入
若shortcode name为randomimg,则插入的shortcode就是

VN:F [1.9.7_1111]
Rating: 10.0/10 (1 vote cast)
Categories: Wordpress Tags:

李嘉诚在深圳大梅沙的演讲

March 10th, 2012 admin No comments

打工是最愚蠢的投资——— 很多人会认为打工是在赚钱。其实打工才是最大最愚蠢的投资。 人生最宝贵的是什么?除了我们的青春还有什么更宝贵? 很多人都抱怨我穷,我没钱想做生意又找不到资金。多么的可笑!其实在你身上就有着一座金山(无形资产),只是你不敢承认。宁可埋没也不敢利用。宁可委委屈屈地帮人打工,把你的资产双手拱让给了你的老板。

我们试想一下,有谁生下来上天就会送给他一大堆金钱的?有谁是准备非常齐全了完美了再去创业就成功了?计划赶不上变化,特别是在如今这个信息高度快速传播的年代! 我曾经问过我的一个朋友为什么不去打工?他的回答很惊人:“说 句得罪点,出去打工简直就是愚蠢浪费青春!为什么你一直是打工仔?因为你安于现状!因为你没有勇气,你天生胆小怕事不敢另择它路!所以你是打工仔!因为你 没有勇往直前,没有超越自我的精神!所以,你还是一个打工仔!你想过了改变你的生活,改变你穷困的命运,但是你没有做!因为你不敢做!你害怕输,你害怕输 的一穷再穷!你最后不敢想,还是在打工,所以你还是打工仔!!!你努力了,你拼搏了,你抱着雄心大志。结果你没看到预想的成就!你放弃了!你只还是一个打 工仔!!

为 什么你一直是打工仔?因为你随波逐流!近墨者黑,不思上进,分钱没得,死爱热闹,所以你一直是打工仔!因为你畏惧你父母,你听信你亲戚,你没有主张,你不 敢一个人做决定。所以,你只不过还是一直是一个打工仔!你观念传统,只想打工赚点钱结婚生子,然后生病老死,走你父母一模一样的路,所以你一直是打工仔! 你天生脆弱、脑筋迟钝只想做按部就班的工作,你想做无本的生意,你想坐在家里等天上掉陷饼,所以你一直是一个打工仔!你抱怨没有机遇,机遇来到你身边的时 候你又抓不住!因为你不会抓!所以你还是一直是打工仔!因为你的贫穷,所以你自卑!你退缩了!你什么都不敢做!你只会给别人打工!所以你一直是打工仔!你 没有特别技能,你只有使蛮力!你和你父母一样,恶性循环,所以,你一直永远的一个一直在打工的打工仔!

很多人想把握机会,要做一件事情时,但往往给自己找了很多理由让自己一直处于矛盾之中,不断浪费时间,虚度时光。如——

1 、 我没有口才 错:有没有人天生就会说话,台上的演讲大师也不是一下子就能出口成章,骂人的时候很擅长,抱怨的时候也很擅长,这也是口才,只是没有任何营养罢了,那是没 有价值的口才;看别人争论的时候,自己满嘴评头论足,却不反省自己,倘若你做得好,你今天是否还说自己没口才?

2 、我没有钱 错:   不 是没有钱,而是没有赚钱的脑袋,工作几年了没有钱么,有了,但是花掉了,花在没有回报的事情上面,吃喝玩乐,或存放贬值了,没有实现最大化,所以钱就这样 入不敷出,这样月光光 这样被生活所需全部一一使用,这样周而复始,每月做个月光族,没有远虑,当一天和尚敲一天钟,得过且过。

3 、我没有能力 错: 不给自己机会去锻炼,又有谁一出生就有跑的能力?跳的能力?一毕业就是社会精英?一创业就马上成功?当 别人很努力的学习,很努力的积累,努力的找方法,而他每天就做了很少一点就觉得乏味,学了一些就觉得没意思,看了一些就不想看,跟自己跟别人说没兴趣学, 然后半辈子过去,一事无成,然后牢骚上天不给机会。能力是努力修来的,不努力想有能力,天才都会成蠢材,但努力,再笨的人也能成精英。

4 、我没有时间 错:时间很多,但浪费的也很多,别人很充实,他在看电视,别人在努力学习时,他在游戏消遣虚度,总之时间就是觉得很多余,他过得越来越无聊,别人赚钱了羡慕别人,但不去学别人好好把握时间创造价值,整天不学无术。

5 、我没有心情 错:心情好的时候去游玩;心情不好的时候在家喝闷酒,心情好的时候去逛街,心情不好的时候玩游戏,心情好的时候去享受,心情不好的时候就睡大觉,好坏心情都一样,反正就是不做正事。

6 、我没有兴趣 错:兴趣是什么,吃喝玩乐谁都有,没有成就哪里来的尽兴,出去旅游回来月光族,出去K歌 回头钱包空空,出去大量购物回来惨兮兮。打工有没有兴趣,挤公车有没有兴趣?上班签到下班打卡有没有兴趣?家里急需要一大笔钱的时候借钱有没有兴趣?要还钱没钱还有没有兴趣?卖老鼠药的人对老鼠药有没有兴趣……?

7 、我考虑考虑 错:考虑做吧,有可能就成了!不做吧,好不甘心,整天上班也没有个头,还是做吧,明天开始,不过还是算了,再想想,这钱挣的也不容易,不不,就是打工挣钱也不容易,所以不能放弃机会,决定了,把握机会。 哎呀!天都黑了,明天再说吧!然后第二天又因为以上123456点,因为左思右想,继续循环,最终不能决定,犹犹豫豫,还是一无所获。

有句话是,可怜之人必有可恨之处! 这一生中不是没有机遇,而是没有争取与把握,借口太多,理由太多……! 争取之人必竭力争取,一分钱都没有也千方百计想办法 ,不争取之人给一百万也动不起来,发财不了,还有可能一败涂地,这就是行动上的欠缺,喜欢犹豫不决, 喜欢拖延,喜欢半途而废,最后一辈子平庸,庸碌无为!还有的人,做事三分钟热度,一开始热情高涨,等会就继续懒散,这种人成功的帽子也不会在你的头上。

看看为什么别人身价几个亿,你自己还在为钱奔波,不要羡慕别人命好,别人很困难的时候是怎么坚挺过来的,怎么克服困难、突破自己、改变命运的,你没看到罢了。活着就是要一身价值。

VN:F [1.9.7_1111]
Rating: 10.0/10 (1 vote cast)
Categories: Miscellany Tags:

Using Google search within a WordPress site

February 27th, 2012 admin No comments

Let’s face it; WordPress search sucks.

Its harsh, I know, but its true. Google didn’t dominate the Internet because they found decent search results. They’ve built an empire upon sophisticated algorithms that help us find extremely specific things amongst the trillions of possible pages.

WordPress publishes the content. Let’s let Google find it.

This tutorial will show you how to use a Google Custom Search Engine (CSE ) to replace the WordPress search engine and integrate it seamlessly into your website.

Note that Google CSE will only search pages they have indexed. Meaning, if you setup your site today then the Google bot may not have crawled it and made your pages available for search.

Setup your search engine

1. The first step to using a Google CSE is to use your Google account to create the search engine. Go to http://www.google.com/cse/ and once you are logged in, click “Create a Custom Search Engine”.

Screenshot of Google Custom Search Engine setup step 1

2. Next, name your search engine, provide a description and then add the domains you would like to search (your WordPress site’s domain and any others you’d like to include).

3. Click “Next”.

4. On the “Try it out” page you can just click “Next” again.

5. At this point you’re given code to paste into your site. Ignore this code and click on the “Change the look and feel” link.

6. Choose the “Two page” layout.

7. Click “Save & get code”.

Copy & paste code to your site

1. Where it asks you to provide the search results URL, use your sites domain: http://example.com

Screenshot of completed Google Custom Search Engine displaying code

2. Where it asks you to provide the query parameter, use the letter s. s is the query that WordPress uses to search the database.

3. Copy the search form code it gives you and paste it into searchform.php (or create this file if you don’t have one) in your theme. Replace the contents of this file.

4. Copy the search results code it gives you and paste it into search.php (or create this file if you don’t have one) in your theme. Only replace the loop (everything between the if ( have_posts() ) : and endif;. Your loop may start and finish a little differently than that.

Seriously, that’s it

Now anywhere you had a search form you should be able to enter a term, hit Enter and be taken to your search page with relevant results. Use the WordPress Search widget to place a search box anywhere on your site.

Some extra goodies though …

Check the “Include Google Analytics Site Search tracking code” box. Then go edit your Google Analytics profile and specify the search paramenter (remember … s).

Because you’re using the WordPress search query you are actually doing a WordPress database search behind the scenes, but because we replaced the loop with the new code we don’t see any results. The DevPress search page actually uses Google’s search and WordPress’ search. In the sidebar of our search results page we break search results out into specific categories just to give a bit more information and context so results.

Origin: http://devpress.com/blog/using-google-search-within-a-wordpress-site/

VN:F [1.9.7_1111]
Rating: 9.7/10 (3 votes cast)
Categories: Wordpress Tags:

Magento Tips

February 23rd, 2012 admin No comments
Categories: Magento Tags:

Magento : How to add a static CMS block to the side bar (twitter example)

February 21st, 2012 admin No comments

Step one.. get the twitter code from here : http://twitter.com/about/resources/widgets/widget_profile

Style it to match the colour, size and shape of your theme.

Your final code will look something like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 8,
interval: 6000,
width: 'auto',
height: 200,
theme: {
shell: {
background: '#333333',
color: '#ffffff'
},
tweets: {
background: '#000000',
color: '#ffffff',
links: '#4aed05'
}
},
features: {
scrollbar: true,
loop: false,
live: true,
hashtags: true,
timestamp: true,
avatars: false,
behavior: 'all'
}
}).render().setUser('dx3webs').start();
</script>

Step Two

In Magento Goto CMS > Static Blocks.

Create a new block

Title: myTwitter

Indentifier: twitter

Status: Enabled
Content: Paste your twitter code in here.

Save

Step Three
Open app/design/frontend/xxxxxx/xxxxxx/layout/catalog.xml

Add your static block to the left or right section in

1
<!-- Mage_Catalog -->

(near the top of the file)
For example to add to the left sidebar.. (Having already removed that damned dog call out)

1
2
3
4
5
<reference name="left">
<block type="cms/block" name="myTwitter" >
<action method="setBlockId"><block_id>twitter</block_id></action>
</block>
</reference>

Bingo you have a new block showing your twitter updates. Needless to say you can add any html you like.

VN:F [1.9.7_1111]
Rating: 9.0/10 (2 votes cast)
Categories: Magento Tags:

鸣人他妈临死的时候对鸣人说的话

February 17th, 2012 admin No comments

不能挑食
每天都要吃饱,茁壮地长大
记得没每天都要洗热水澡
还有,别熬夜,保证睡眠充足
另外要结交朋友
朋友不多也没关系,有几个信赖的伙伴就够了
尽管妈妈我不太擅长…
你要好好学习,努力掌握好忍术
不过谁都有擅长和不擅长的事
即使学得不顺利,也没必要垂头丧气
要尊敬研修班的老师和长辈
还有一件要紧的事,关于忍者的三禁
首先不能随意借贷金钱
任务酬劳要记得好好存着
酒要等你满20岁才能喝
喝太多对省体不好,要适可而止
还有就是三禁的 女人
妈妈是女人,所以不太懂这一条
总而言之,这个世界上只有男女之分
你迟早会对女性感兴趣
就是当心别被奇怪的女人缠上
要找妈妈这样的出色女性
还有。。。说到三禁,还有一点
你可要当心自来也老师
鸣人,今后无论辛酸还是痛苦
你都会遭遇很多
要秉持自己的步调
还要心怀梦想
然后将梦想付诸实际
要对自己有信心

VN:F [1.9.7_1111]
Rating: 7.3/10 (7 votes cast)
Categories: Miscellany Tags: