自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(103)
  • 收藏
  • 关注

原创 Create and maintain your own bower package

ReferencePrerequisiteA step by step example1.Have a public git repo ready2. register the package3. Add version to the package4. Install the package5. Maintain the package

2017-03-22 05:31:32 511

原创 Silence output of return object in IRB console on windows

Why sometimes we may want to disable outputting return object?How to disable?

2017-03-04 03:17:12 481

原创 MAC PHP7 如何disable xdebug

1. 查看xdebug当前状态是否是enable2.找到php配置文件夹3.打开xdebug配置文件,把所有代码都注释掉4.验证已经成功disable了xdebug

2016-10-12 10:44:53 2555

原创 MAC 安装 Magento2 community edition 详细步骤

在Mac OS X EI Capitan上成功安装magento2.1.1 详细记录每个步骤。1. 确保系统满足prerequisiteMySQL error;php extension error;Admin page not found error2. 开始安装获取初始文件;修改文件夹权限;Lauch magento setup guide(readiness check; add a database)3.安装成功,开始使用deploy static content; refresh ca

2016-10-10 01:00:40 4383

原创 MAC 更新 PHP 指南 以及 PHP常用命令示例

1. 安装新版本PHP打开terminal,运行:curl -s http://php-osx.liip.ch/install.sh | bash -s 7.02.把php文件夹路径加入到$PATHexport PATH=/usr/local/php5/bin:${PATH}查看版本: php -v获取php excutable所在文件夹路径:which php获取php.ini文件所在文件夹位置:php -i | grep php.ini查看某个module是否enable了: php -

2016-10-09 00:26:11 5030 1

原创 MAC 设置$PATH 关闭terminal后就失效 解决方案

1 目标修改$PATH的值2 问题在terminal中修改了$PATH,关闭terminal或者换个terminal就不存在了。3 解决方案找到当前用户文件夹下的.bash_profile,将需要添加的路径加入其中。

2016-10-09 00:10:59 14444

原创 MAC 修改文件夹以及子文件夹和子文件权限 以及 修改文件夹owner

1. 打开Finder,找到想要修改权限的文件夹,打开文件信息对话框。2 修改文件夹的拥有者2.1 如何判断哪个用户是当前拥有者2.2 如何设置新的文件夹拥有者2.2.1 解锁2.2.2 设置owner2.2.3 确认设置owner成功3 修改用户对文件夹的读写权限3.1 点击右下方”lock“图标解锁3.2 仅修改当前文件夹权限3.3 同时修改所有子文件夹以及子文件的权限

2016-10-08 23:02:48 49994 2

原创 Rails add a search function controller and route best practice

How to render the search page?How to perform the search function?How to render the item list page?How to design controller, routes, and view.

2016-08-11 21:07:21 497

原创 GoCD notes

Every task in a job is run as an independent program.Changes made by a task to any of its environment variables will not affect subsequent tasks.Changes made by a task on the file system will be visib

2016-08-03 20:54:44 454

原创 Capistrano deploy flow outline

Deploy: starting: Rbenv ensures that the version is correct; Checks git repository; Create needed folder treeDeploy: updating: Copies the projectDeploy: publishing: Bundle install; Assets:precompile; Link current to latest release; Restart serverDeploy:

2016-08-03 20:51:13 462

原创 Capistrano commands explanation

cap deploy:setupcap deploy:checkcap deploy:update_code

2016-08-03 20:43:21 391

原创 Set up Zend Framework Skeleton Application on Mac Step by Step

1. Install Composer2. Verify that Composer is installed successfully3. Install ZendSkeletonApplication4. Verify that ZendSkeletonApplication has been installed successfully

2016-06-08 07:30:27 797

原创 Consul & Registrator & Rails Service all together in separate Docker container

1.Start a container running Consul2.Start a container running Registrator3. Start a web service and let Registrator automatically register it on Consul4. Find the IP address and port of the service from Consul UI, and start using the service

2016-04-23 21:37:01 5675

原创 [Consul]Error starting agent: Failed to get advertise address: Multiple private IPs found.

Problem: Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.Why got this error: If we don’t specify a bind address, Consul will by default listen on the first private IP on the system, and this might no

2016-04-14 02:14:24 8442

原创 USB storage capacity reduced to 2MB from 14GB

Problem:I created a bootable USB stick on Windows. Then My USB storage capacity reduced to 2MB from 14GB.Solution:Step1:Follow the steps from this link: http://askubuntu.com/questions/289971/usbs-storage-capacity-reduced-to-2-mb-from-16-gbStep2:Now w

2016-04-13 01:54:14 741

原创 Install and set up Gitlab CI Runner to use Docker

1.Install GitLab Runner2. Register the runner3. Install docker, set up privileges.4. Register multiple runners and make them run builds concurrently.

2016-03-29 03:15:48 871

原创 Docker - How to create a custom database from docker mysql image

Problem:I use the official mysql base image from Docker Hub to create mysql database. But by default it only creates one database. I want to create another database.Solution:mysql image actually provides a way to do this.So we just need to create a .sq

2016-03-02 22:42:39 1335

原创 Docker - How to Connect to a MySQL Running Container Using MySQL Command Line Client

We used the official mysql image from Docker Hub (https://hub.docker.com/_/mysql/), and created a running database container. And we need to connect to the MySQL database using MySQL command line client.1. Get container_name, image_name, mysql_port_number

2016-02-28 21:02:19 1253

原创 Docker - SSH to Docker Machine - remote host identification has changed!

SSH to Docker Machine - remote host identification has changed!

2016-02-28 20:59:33 831

原创 Docker 命令行汇总

1.General Docker command2.Containers3.Images4.docker-compose

2016-02-28 20:57:26 624

原创 运行第一个 docker image 并在浏览器中查看

1. SSH to Docker 虚拟机2. 下载并运行 Docker Hub 上的 nginx 镜像3.获取虚拟机 IP4. 在浏览器中查看

2016-02-22 10:42:15 6129

原创 Windows 系统安装Docker Compose 步骤

参考 Docker Compose official 官方安装指南: https://docs.docker.com/compose/install/实际上到目前为止还不能直接在Windows上安装Docker Compose,所以这篇文章要讲的是如何在Windows上使用Docker Compose。先决条件: Docker Machine 已经安装完毕。解决方案: 将 Docker-Compose 安装在Boot2Docker虚拟机中。1. SSH to VM2.获得root用户权限3. 运

2016-02-22 10:36:04 8129

原创 Windows系统上3种连接Docker虚拟机的方法

连接到Docker machine用户名: docker密码: tcuser1. Docker Quickstart Terminal2. GitBash3. Powershell / CMD

2016-02-22 10:27:52 9700 1

原创 开始使用Google Analytics 示例

1. 创建一个 Google Analytics 账户2. 创建新的 property3. 填写所有必须填写的框, 建议打开 In-page analysis4. 得到 tracking code5. 添加 tracking code 到网站中

2016-02-01 07:12:14 3219

原创 Rails 使用 Google Analytics 示例

1. 下载Google Analytics, 并且初始化 tracker。 2. 设置 tracking ID 环境变量3. 把 Google Analytics view 加入 application layout4. 在一个 javascript 文件中写入追踪页面访问代码

2016-02-01 07:03:23 627

原创 有用的 Google Analytics Chrome 插件推荐

1.Google Analytics DebuggerDebbuger 会列出所有执行的命令以及传过去的参数。2.Event tracking tracker记录追踪事件API调用。3. Page Analytics这个插件会显示一个简化缩小版Google Analytics报告面板在页面顶部。我常用它来查看in-page analytics.

2016-02-01 06:42:48 980

原创 使用DreamHost当GoDaddy域名的服务器 步骤

1. 在GoDaddy管理员页面中改变DNS设置,指向DreamHost Name servers:进入Domain details page:目前在  SETTINGS -> Nameservers. 数值还是默认值:NS11.DOMAINCONTROL.COMNS12.DOMAINCONTROL.COM我们需要将它修改为 DreamHost nameserv

2016-02-01 06:30:02 2212

原创 JQuery用DELETE method发送Ajax request

Knowledge point:$.post( url [, data ] [, success ] [, dataType ] ) is a shorthand Ajax function, which is equivalent to:$.ajax({ type: ‘POST’, url: url, data: data, success: success,

2015-07-19 09:02:19 5928

原创 Rails用DELETE method提交表单讲解

Sometimes we need to submit form using methods other than ‘post’, in this example, it’s ‘delete’.For example, I wanted to delete a user when a form is submitted with the user name and ‘delete’ met

2015-07-19 08:51:15 1851

原创 Rails Marshal 简单例子讲解

1. Why use Marshal?Basically anytime you want to store a whole object in byte stream and need to retrieve the object from the byte stream later.This is the situation I encountered and also why

2015-06-26 07:37:52 965

原创 Rails Minitest style 指南

In the test,  we should use the ‘describe’,  ‘context’, ‘it’ structure.Here I use a controller test as an example.I have this my_controller.rb with two controller actions:class MyControlle

2015-06-23 08:46:29 1148

原创 用map, next 和 reject 简化代码(ruby)

For example, we have this Channel class:class Channel attr_reader :id, :name def initialize(id, name) @id = id @name = name endend1.What we have:One list of objects:

2015-06-23 08:24:23 1498

原创 Ruby Variable Scope 简单讲解

Name Begins WithVariable Scope$A global variable@An instance variable[a-z] or _A local variable[A-Z]A constant@@A class variable以一个简单例子示例各种变量的区别:c

2015-06-21 02:45:57 1196

原创 第一个 Rails App 从安装到创建(windows版本)

1. 在以下网址下载并运行 Rails 安装包: 点击打开链接2. 检查 ruby,sqlite 和 rails 是否安装成功2.1 查看 ruby 版本, 在命令行中输入:ruby -v运行截图如下:2.2 查看 sqlite 版本,在命令行中输入:sqlite3 --version运行截图如下:2.3 查看 rails 版本,在命令行中输

2015-01-29 07:41:23 854

原创 Javascript 处理 JSON 数据 示例

最近做了一个 MEAN stack 的 app 。后台用 NodeJS 从 Jira rest api 获得JSON数据并做处理,然后前端用 AngularJS Ajax call 获得处理后的 JSON 数据,显示到 App 上。处理了很多 JSON 数据,决定编一个例子,写一个总结。JSON 数据处理,基本就是 JSON String 和 JSON Object 之间的转换。J

2015-01-27 07:18:23 2127

原创 GitHub 配置及简单使用

一. 初始化1. 初始化 git 目录终端中进入到项目文件夹,然后输入以下命令。git init命令执行后,文件夹中会多一个.git 文件夹2. 设置本机关联 GItHub 的用户名和邮箱git config --global user.name ""git config --global user.email ""示例:git co

2015-01-20 12:38:30 1172

原创 Angularjs切换网站配色模式简单示例2(切换body元素的class)

一个网站可以有多种配色方案,例如正常模式,夜间模式等。简单示例一个通过点击toggle 按钮,切换body元素的class,达到切换配色模式的angularjs小app。1. Live范例可以在以下Codepen网址查看: http://codepen.io/ChristyWang/pen/NPxNMx2. Toggle button源代码由以下网站生成:https://p

2014-12-06 05:00:50 2340

原创 Angularjs切换网站配色模式简单示例1(切换css文件)

一个网站可以有多种配色方案,例如正常模式,夜间模式等。简单示例一个通过点击按钮,更换css文件,达到切换配色模式的angularjs 小app。主要文件有三个:index.html(主文件),white.css(白色背景配色方案css文件),black.css(黑色背景配色方案css文件)。index.html文件代码如下:<script src="https://aja

2014-11-21 00:15:20 3526 1

原创 Angularjs Nodejs Grunt 一个例子

做了一个简单的示例,目的是记录环境配置以及这套框架的结构流程。1.配置环境默认nodejs已安装。安装以下模块:express(nodejs框架),grunt(javascript task runner),grunt-contrib-watch(grunt live load插件),grunt-express-server(grunt启动express服务端插件)。命令行中进入程

2014-11-13 00:00:07 3233

原创 第一个express app 详细步骤

1. 全局安装node(网上有很多)。

2014-10-24 06:20:36 2818

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除