- 博客(30)
- 收藏
- 关注
原创 悼念程序员的那些难忘时刻 漫画组图(一)
作为程序员,我们经历过多少风风雨雨,久经沙场,总有一些让人难忘、让人回味的时刻,本系列文章旨在帮你回忆起那些难忘精彩或者悲催的时刻,让我们一起来悼念! 1、你身边的人总是把你当成修电脑的事实上:我只是大部分时间在Google上搜索问题而已。 2、突然你代码写不下去了…但发现Stack Overflow却挂了 3、当你误改了一行代码 4、当你尝试修复...
2016-03-26 01:36:42 360
原创 Magento: 根据产品属性加载产品信息 Load A Category or Product by an Attribute
Load a Product by ID<?php // get product model by product id, assuming you have known product id, $productId$_product = Mage::getModel('catalog/product')->load($productId) Load ...
2016-03-26 01:35:38 105
原创 Magento模块开发之数据库SQL操作方法说明
今天主要来看Magento中的Mysql4/Resource(资源) 如何对数据库进行操作, 来执行更为复杂的 sql 语句。 在Magento中Model 通常都会继承 Mage_Core_Model_Abstract, 而这个 Abstract 又继承了Varien_Object, 在 Abstract 类中包含许多常用的方法,例如: getId(), load(), save(), del...
2016-03-26 01:31:54 433
原创 git reset, git checkout, git revert 区别 (译)
题记:团队中大多数成员使用 sourceTree 和 github 两款 git 工具,然而大家对于图形化工具提供的 reset,checkout,revert 功能点并不是很了解,甚至于混淆,然后凭借猜测去使用。功夫不负有心人,在尝试过多次冲突处理或分支开发的坑后,终于形成了自己的一套使用方式,可喜可 贺。然而问题的解决方案的并不是效率最高的,内部的执行过程我们也不清楚,这对于一个自律的程...
2016-03-26 01:26:23 972
原创 CSS: 指向目标下第一层或者全部层的元素 Target first level <li>s and not the nested <li>...
Have a container <div> with a class, and use the > selector. Lets say your container div's class is "myclass":.myclass ul li { ...this will affect both levels of li.}.myclass >...
2016-03-26 01:06:58 2429
原创 Bootstrap 3: 无限级别下拉菜单 Multi level dropdown menu in Bootstrap 3
HTML:<div class="container"> <div class="row"> <h2>Multi level dropdown menu in Bootstrap 3</h2> <hr> <div class="dr
2016-03-23 02:05:46 573
原创 Magento: 通过id获取类别名字等信息 get category by id
<?php // get category model by category id, assume you have known category id, $categoryId$_category = Mage::getModel('catalog/category')->load($categoryId); // category name$cate...
2016-03-23 02:03:57 467
原创 Magento事件与事件监听
事件和事件监听也许是magento中最有趣的功能之一,因为它允许开发者来扩展magento应用程序中的关键部分。 为了为不同模块之间提供更多的灵活性和便利,magento使用了一种事件/监听模式,这种模式允许模块之间进行松散耦合。 在这个系统中有两部分,一部分是事件分发对象和事件信息,另一部分是监听特定的事件。Magento事件与事件监听 一、事件分发事 件的创...
2016-03-23 02:02:41 426
原创 Magento: 获取类别所有子类别 (无限级别-目录树) Get All Sub Categories
生成分类目录树(Category Tree)$rootcatId = Mage::app()->getStore()->getRootCategoryId();$categories = Mage::getModel('catalog/category')->getCategories($rootcatId); function get_categories...
2016-03-23 02:01:59 372
原创 PHP类: SEO必备的伪原创工具 (文章重写)
伪原创工具是一种基于SEO理论的网络文章编辑软件的统称,主要功能是把从网上复制来的文章进行“原创”操作。让复制来的文章瞬间变的看起来像原创一样,然后达到让搜索引擎认为是“原创”从而提高网站收录率,和收录数量。专门针对谷歌、百度、雅虎等大型搜索引擎收录设计,通过伪原创工具生成的文章,会更好的被搜索引擎收录和索引到。 方法一: 在线工具这个就不多说了,直接谷歌一下就可以,实在不...
2016-03-23 02:00:33 2731 1
原创 Magento: 获取产品评论 get all reviews with review summary
1. 根据产品id获取该产品评论$productId = 1234;$product = Mage::getModel('catalog/product')->load($productId);$storeId = Mage::app()->getStore()->getId();Mage::getModel('review/review')->get...
2016-03-18 01:19:26 323
原创 Android模拟器genymotion的安装和使用
Genymotion概述Genymotion是一套完整的工具集,旨在为Android提 供虚拟环境。开发人员、测试人员、销售人员甚至是游戏玩家都能从中获得众多实用功 能。 它可用于大多数操作系统:Windows、Linux以及MacOS X。它既易于安装,又具备强大的功能:遵循简单的安装流程指引、选择一款Android虚拟设备、启动工具,大功告成! Genymotion特色最佳A...
2016-03-18 01:16:46 152
原创 分享按钮 Social Buttons for Bootstrap
官网:http://lipis.github.io/bootstrap-social/View on GitHub : https://github.com/lipis/bootstrap-socialDownload:bootstrap-social-gh-pages How to useInclude Bootstrap and Font Aweso...
2016-03-18 01:15:43 349
原创 谷歌网站翻译插件 Website Translator
go to website: https://translate.google.com/manager/website/ Vertical <div id="google_translate_element"></div><script type="text/javascript">function googleTran...
2016-03-18 01:15:18 1689
原创 Magento: How to add custom qty field to custom option of simple product magento
By default in magento there is no qty field of simple product for custom option. If you want to add qty as per your custom option you can add now using this post. Suppose you have custom option '...
2016-03-18 01:13:22 99
原创 HTML5中的服务器发送事件Server-sent events
HTML5加了许多新功能,其中服务器发送事件Server-sent events是一个亮点,以下直接贴上代码示例 客户端a.html页面<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>服务器推送SS...
2016-03-11 05:50:33 913
原创 解决WP表前缀更换后出现的You do not have sufficient permission
将安装的wordpress表前缀由默认的 wp_修改为其它了,再次登陆后台后出现You do not have sufficient permissions to access this page.网上搜索了一下,说是修改检查 wp_usermeta 表中的 wp_capabilities, wp_user_level 数值,但是无效,再搜索发现如下方法解决问题 步骤1....
2016-03-11 05:49:24 2230
原创 jQuery - Bootstrap 3 and Youtube in Modal
1. 效果一HTML<a href="#" class="btn btn-default" data-toggle="modal" data-target="#videoModal" data-theVideo="http://www.youtube.com/embed/loFtozxZG0s">VIDEO</a><d
2016-03-11 05:48:31 206
原创 Magento: Service Temporarily Unavailable 解决
My Application was working fine yesterday. I started my Pc today when I tried to start magento I Got This Error message. Service Temporarily Unavailable The server is temporarily unable...
2016-03-11 05:46:59 427
原创 Ubuntu 15 安装Chromium浏览器并添加Flash插件Pepper Flash Player
Chromium谷歌的开源浏览器将不再支持Netscape浏览器插件API,Adobe公司的Flash将无法正常工作了。然而用户可以使用Pepper Flash Player,这是谷歌浏览器上一款替代Adobe Flash的插件。Ubuntu 15 安装Chromium浏览器并添加Flash插件Pepper Flash Player安装方法Ubuntu 14.04及衍生版本用户命令...
2016-03-11 05:45:24 129
原创 Magento: 设置产品列表默认排序方式 How to sort Magento products by date added as default
方法一: 安装插件 Sort By Date(https://www.magentocommerce.com/magento-connect/sort-by-date.html) 方法二: 非插件Today I had to change Magento default products list sorting to sort by product’s date. In fac...
2016-03-10 06:22:59 270
原创 Magento: 添加first name 和 last name到newsletter Add additional fields to your newsl
1. 首先,自定义添加区域,安装插件 Extended Newsletter Subscription (https://www.magentocommerce.com/magento-connect/extended-newsletter-subscription.html)Magento: 添加first name 和 last name到newsletter Add additio...
2016-03-10 06:20:58 115
原创 Ubuntu全盘备份与恢复
备份: 下面是我用来备份系统的完整命令:tar -jpcvf Ubuntu-12.04-20131018.tar.bz2 --exclude=/proc --exclude=/lost+found --exclude=/Ubuntu-15.10-20160211.tar.bz2 --exclude=/mnt --exclude=/sys --exclude=/home / 让我们来简...
2016-03-10 06:19:08 1111
原创 CSS:absolute居中 How to center absolute div horizontally using CSS
You need to set left:0; right:0;.This specifies how far to offset the margin edges from the sides of the window.http://www.w3.org/TR/CSS2/visuren.html#position-propshttp://jsfiddle.net/SS6DK/...
2016-03-10 06:15:43 87
原创 Magento 添加 google font Adding a google fonts into Magento
方法一:In your theme located at app/design/frontend/YOUR_THEME/YOUR_TEMPLATE/layout/local.xml just add the code below:<?xml version="1.0"?><layout> <default><!-- use for a...
2016-03-10 06:12:39 99
原创 Ubuntu: 正确安装wine Wine 1.7 not installing on Xubuntu 15.10
The needed packages are currently not available for Wily. Check this filtered page.Wait some days and the Wily packages are likely to be available. In the meantime, install the Vivid packages:w...
2016-03-09 02:30:20 174
原创 Node.js listen EADDRINUSE 错误解决 How to solve nodejs Error: listen EADDRINUSE
代码var http = require('http');var requestListener = function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello You\n');}var server = htt...
2016-03-09 02:28:02 198
原创 bxslider 纵向滑动 vertical image thumbnail slider
1. 简单版 HTML:<ul class="bxslider"> <li><img src="/images/730_200/hill_trees.jpg" /></li> <li><img src="/images/730_200/me_trees.jpg" /&am
2016-03-09 02:27:12 447
原创 Magento: 自动生成产品SKU Auto generated SKU when add product in magento
方法一:Open /app/design/adminhtml/default/default/template/catalog/product/edit.phtml and add the following code to the bottom of the file:<?php $dbread = Mage::getSingleton('core/resource')...
2016-03-09 02:26:02 166
原创 Magento: 设置category类别为必填 How to make product category selection required
You can rewrite the method Mage_Adminhtml_Catalog_ProductController::validateAction() and check if the product is new and category_ids hasn't been sent through POST then throw an exception.Somethin...
2016-03-09 02:23:27 185
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人