jfo planet

Hope is the best gift that tomorrow gives.

  • 首页
  • 分类
  • 归档
  • 标签
  • 搜索
close

Wordpress Custom URLs for Plugins

发表于 2013-05-20   |   分类于 wordpress
Wordpress supports custom URL rewrites for search engine friendly URLs, but the fact is they can be a real pain in the ass for WP plugin authors. As is evidenced by the plethora of confused posts out there desperately seeking help with add_rewrite_rule() and add_rewrite_tag(), slapping a few new rules and custom querystring variables in your plugin’s functions.php just doesn’t always cut it. Custom URLs for Wordpress PluginsTake the following scenario: you have a custom plugin for displaying pro ...
阅读全文 »

Loading JavaScript without blocking

发表于 2013-05-06   |   分类于 python/js/php/html/mysql/http
I was reading Steve Souder’s blog post on loading scripts without blocking in which he notes that dynamically creating a <script> element and assigning its src attribute leads to a download that doesn’t block other downloads or page processes. His post is missing an example of how to do this, so I thought I’d pick up from there. I think most developers tend to use JavaScript libraries for such behavior (the YUI Get utility comes to mind) but a discussion of the underlying technique is s ...
阅读全文 »

javascript继承

发表于 2013-02-24   |   分类于 js/html/python
TypeScript编译生成的继承:var extends = this.extends || function (d, b) {    function () { this.constructor = d; }    .prototype = b.prototype;    d.prototype = new ();};var Greeter = (function () {    function Greeter(message) {        this.greeting = ...
阅读全文 »

virtualbox中调整虚拟机的硬盘大小,再fdisk 扩大ext3分区

发表于 2013-01-21   |   分类于 Linux App
VBoxManage.exe modifyhd E:ubuntu_64.vdi  showhdinfoUUID:                 d476f654-3100-4530-b645-31dcaf80ae56Accessible:           yesLogical size:         28723 MBytesCurrent size on disk: 23389 MBytesType:        &nbs ...
阅读全文 »

用wget从oracle官网下载jre,jdk

发表于 2013-01-20   |   分类于 Java
wget –no-cookies –header "Cookie: gpw_e24=aaa" http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jre-6u38-linux-x64.binreference: http://ivan-site.com/2012/05/download-oracle-java-jre-jdk-using-a-script/JDK 7u10http://download.oracle.com/otn-pub/java/jdk/7u10-b18/jdk-7u10-linux-i586.rpmhttp://download.oracle.com/otn-pub/java/jdk/7u10-b18/jdk-7u10-linux-i586.tar.gzhttp://download.oracle.com/otn-pub/java/jdk/7u10-b18/jdk-7u10-linux-x64.rpmhttp://dow ...
阅读全文 »

Service中创建窗口显示(TYPE_SYSTEM_ALERT, TYPE_SYSTEM_OVERLAY)

发表于 2012-12-21   |   分类于 Android
http://blog.csdn.net/zmyde2010/article/details/6863717有时候需要在显示UI的时候不中断原来的Activity比如在播放视频时或者玩游戏时,需要显示某个菜单(可以是系统提示,或类似于TV菜单)显然用Activity来做是不行的,因为新Activity启动的时候会把原来的Activity pause掉怎么做呢,可以参考系统电量提示窗口或statusbar那样在service中启动窗口新窗口将会出现在UI最上层,但不会中断原来的Activity效果图,一个是播视频中,一个是玩游戏中:看一下WindowManager.LayoutParams的两个属性:intTYPE_SYSTEM_ALERT        Window type: system window, such as low power alert.intTYPE_SYSTEM_OVERLAYWindow&nb ...
阅读全文 »

开发框架

发表于 2012-12-02   |   分类于 framework
1. webasystWebasyst is an open source PHP framework for developing sleek multi-user web apps, and complex websites.download here: http://www.webasyst.com/framework/environment download here: http://www.apachefriends.org/en/xampp-windows.html
阅读全文 »

Javascript的构造函数和constructor属性

发表于 2012-11-30   |   分类于 js/html/python
Chrome下执行如下代码:注意,这个时候obj的constructor已经不再是创建它的函数,但是修改构造函数的prototype的contructor并不会影响构造函数所产生的对象!这里仍然会调用原来定义的MyClass进行构造,而不会调用新的MyClass.prototype.constructor进行构造。更多烧脑筋的constructor例子请 参考:Constructors considered mildly confusing (如果连接无法打开,可向作者索要pdf文档)这里仅摘录两段 instanceof 例子:function MyConstructor() {}MyConstructor.prototype = {};var myobject = new MyConstructor();myobject instanceof MyConstructor // true  ...
阅读全文 »

jQuery中Deferred的实现原理

发表于 2012-11-30   |   分类于 js/html/python
Deferred提供了一种用非阻塞的串行逻辑方式编写异步执行代码。defer的用法:function doJob() {    var defer = $.Deferred();    var image = new Image();    var url = "http://hiphotos.baidu.com/j_fo/pic/item/5fd4af345982b2b7e633367931adcbef77099b6b.jpg&quot;;    image.onload = function() {        alert("success");  ...
阅读全文 »

JavaScript原型和继承 - a special example by jfo

发表于 2012-11-28   |   分类于 js/html/python
function A() { A.prototype = { print: function(){ alert(“print”); } };}var a = new A();a.print(); // will cause exception: Object #<A> has no method ‘print’a = new A(); // new second timea.print(); // ok now  A本身是一个普通对象:   第一次new A() 的时候,先申请一片内存空间,赋予变量a,并将a的[[Prototype]]指向A.prototype(此时还没有print函数) 然后执行constructor,即A函数体,并将A的prototype重设(此时print函数设置完成)   这样第二次new A() 的时候,a的[[Prototype]]指向我们自己设置的那个prototype对象,就可以调用print函数了     参考:Jav ...
阅读全文 »
1…91011…61
jfo

jfo

605 日志
38 分类
4 标签
RSS
GitHub 微博
友情链接
  • 收藏夹
  • 网络剪贴板
  • 爱逛吧
© 2007 - 2018 jfo
由 Hexo 强力驱动
主题 - NexT.Pisces