Month: December 2015

MongoDB 教程一: 安装和使用 (Mongodb启动命令mongod参数说明)

(视频来源:php兄弟连) 系统教程目录: MongoDB 教程索引 (附有视频)   Mongodb启动命令mongod参数说明 我们可以通过mongod --help查看mongod的所有参数说明,以下是各参数的中文解释。 基本配置 –quiet # 安静输出 –port arg # 指定服务端口号,默认端口27017 –bind_ip arg # 绑定服务IP,若绑定127.0.0.1,则只能本机访问,不指定默认本地所有IP –logpath arg # 指定MongoDB日志文件,注意是指定文件不是目录 –logappend # 使用追加的方式写日志 –pidfilepath arg # PID File 的完整路径,如果没有设置,则没有P… Read More

在Ubuntu上安装mongoDB

1. 官网: Synopsis This tutorial outlines the basic installation process for installing MongoDB on Ubuntu Linux systems. This tutorial uses .deb packages as the basis of the installation. 10gen publishes packages of the MongoDB releases as .deb packages for easy installation and management for users of Ubuntu systems. Ubuntu does include MongoDB package… Read More

通过包管理器安装 Node.js

Note: The packages on this page are maintained and supported by their respective packagers, not the Node.js core team. Please report any issues you encounter to the package maintainer. If it turns out your issue is a bug in Node.js itself, the maintainer will report the issue upstream. Debian and Ubuntu based Linux distributions Enterprise Linux and

JQuery: 使用Ajax赋值给全局变量失败异常的解决方法,ajaxSetup, jquery ajax global

我们在用JQuery的Ajax从后台提取数据后想把它赋值给全局变量,但是却怎么都赋不进,为什么呢? 原因其实很简单,我们用的Ajax是异步操作,也就是说在你赋值的时候数据还没提取出来,你当然赋不进去,所以只要改成同步操作就行~ 方法1:先设置同步在进行Ajax操作 //在全局或某个需要的函数内设置Ajax异步为false,也就是同步 $.ajaxSetup({ async :false}); //然后再进行你的Ajax操作 $.post(地址,参数,function(data, status){if(status =="success"){//赋值给全局变量}else{ alert("wrong");}}); 方法2… Read More

Bootstrap 3: 监听弹出窗口关闭/打开事件 How to handle the modal closing event in Twitter Bootstrap?

Updated for Bootstrap 3 Bootstrap 3 documentation refers two events you can use hide.bs.modal: This event is fired immediately when the hide instance method has been called. hidden.bs.modal: This event is fired when the modal has finished being hidden from the user (will wait for CSS transitions to complete). And provides an example on how to use them: $('…

git-ssh 配置和使用

1、设置Git的user name和email:(如果是第一次的话) $ git config --global user.name "humingx" $ git config --global user.email "humingx@yeah.net" 2、生成密钥 $ ssh-keygen -t rsa -C "humingx@yeah.net" 连续3个回车。如果不需要密码的话。 最后得到了两个文件:id_rsa和id_rsa.pub。 如果不是第一次,就选择overwrite. 3、添加密钥到ssh-agent 确保 ssh-agent 是可用的。ssh-agent是一种控制用来保存公钥身份验证所使用的私钥的程序,其实ssh-agent… Read More

git/ssh捋不清的几个问题

主要是 windows 用户会遇到很多纠结的问题,linux/unix 用户属于这方面的高端用户,应该有能力处理此类问题,而且网络上也有很多解决方案,本文的受众是 windows 用户。由于今天配置了一下午,虽说配置过程基本搞清楚,懒得重新配置一遍,所以文中皆以文字形式叙述,没有截图。 一、概念的解释 1. rsa 与 rsa.pub 网上很容易搜到的东西我就不说了,我们知道,通过: ssh-keygen -t rsa -C "something" 可以生成两个文件,这两个文件的命名默认是 id_rsa 和 id_rsa.pub,如果你在键入上述命令回车之后,重新输入了命名,那此时生成的两个文件就是 [命名] 和 [命名].pub,这个好… Read More

Magento: 左栏筛选条件 Select Box / Button / Dropdown List on Layered Navigation

1. 下拉框 Select Box You have plain text and link to those text in Magento Layered Navigation section. You can easily change the display of Layered Navigation links into a selection box / dropdown list. To do so, you need to edit the following file: app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/catalog/layer/filter.phtml filter.phtml file con… Read More

Bootstrap3 价格滑动块 price range bootstrap-slider

实例: HTML <input type="text" class="span2" value="" data-slider-min="0" data-slider-max="255" data-slider-step="1" data-slider-value="128" data-slider-id="GC" id="G" data-slider-tooltip="hide" data-slider-handle="round" > CSS /*! * Slider for Bootstrap * * Copyright 2012 Stefan Petre * Licensed under the Apache License v2.0 * ht… Read More

Magento: 单产品(product)或者当前类别(category)最大和最小价格 Min/Max Product Price in a Category

1. 当前类别最大最小价格: $minPrice = Mage::getModel('catalog/product')->getCollection() ->addStoreFilter() ->addAttributeToSelect('price') ->addAttributeToSort('price', 'ASC')->getFirstItem()->getMinimalPrice()*1; $maxPrice = Mage::getModel('catalog/product')->getCollection() ->addStoreFilter() -&g… Read More

linux: 命令行运行php Run PHP from the command line

As an alternative to /opt/lampp/bin/php, to run a php script from the command line, you just need to install php5-cli: sudo apt-get install php5-cli And run your script with: php myscript.php To open an interactive php shell, just type in a terminal: 如果想在terminal里面直接写php,可以用: php -a   本文:linux: 命令行运行php Run PHP from the command line… Read More