Skip to content

Instantly share code, notes, and snippets.

View abruzzi's full-sized avatar
⌨️
Writing a React book - React Anti-Patterns

Juntao Qiu abruzzi

⌨️
Writing a React book - React Anti-Patterns
View GitHub Profile
@abruzzi
abruzzi / index.html
Created January 6, 2014 14:14
Quick intro of how two controllers communicating.
<!DOCTYPE html>
<html>
<head>
<tit1e>AngularJS Tutoria1s</title>
<link rel="stylesheet” href=“vendor/foundation/foundation.min.css">
</head>
<div ng-app="myApp">
@abruzzi
abruzzi / openlayers-angular-demo
Created January 12, 2014 15:08
openlayers with angularjs popup demo
var app = angular.module('OpenLayersApp', []);
app.controller('EventController',
['$scope', '$compile', '$timeout', function($scope, $compile, $timeout) {
var map = new OpenLayers.Map("map",{projection:"EPSG:3857"});
var osm = new OpenLayers.Layer.OSM();
var toMercator = OpenLayers.Projection.transforms['EPSG:4326']['EPSG:3857'];
var center = toMercator({x:-0.05,y:51.5});
@abruzzi
abruzzi / how-to-configure-apt-get.md
Created January 15, 2014 09:00
How to configure apt-get after you had ubuntu installed.

Proxy settings

Touch the proxy configuration file if needed

sudo vi /etc/apt/apt.conf.d/80proxy

Add the following configuration:

@abruzzi
abruzzi / notes-js.md
Last active January 3, 2016 13:08
Some Useful notes on Linux

underscore.js

Given I have a data structure like this

{
	"JSESSIONID": "6C729E682C05AA56017E3D1675CE8E5F",
	"_USER": "GEO-NASTAR"
}
@abruzzi
abruzzi / nginx.conf
Created January 19, 2014 03:05
A sample nginx configuration file
user nobody;# 工作进程的属主
worker_processes 4;# 工作进程数,一般与 CPU 核数等同
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
describe('e2e: main', function() {
var ptor;
beforeEach(function() {
browser.get('/');
ptor = protractor.getInstance();
});
it('should load the home page', function() {
@abruzzi
abruzzi / jasmine-jsonpath.js
Created January 23, 2014 09:56
Jasmine-jsonpath
(function (jasmine, jsonPath) {
'use strict';
jasmine.getNodeByPath = function(obj, path, arg) {
return jsonPath(obj, path, arg);
};
beforeEach(function() {
this.addMatchers({
toHasJsonPath: function(path) {
var actual = this.actual;
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@abruzzi
abruzzi / Readme.md
Last active January 10, 2017 02:43
Setup E2E testing enviornment on Ubuntu(with selenium standalone and Xvfb)

Setup E2E testing enviornment on Ubuntu

这篇文档中,会介绍如何在Ubuntu中设置端到端的测试环境。这个环境中,需要一些软件作为基础设置

  1. Xvfb
  2. Selenium
  3. Protractor
  4. Chrome+ChromeDriver

按装并设置完成之后,这个环境可以运行基于Web的应用程序的单元测试(基于Karma或者Jasmine),以及端到端测试(基于Protractor)。事实上,基于selenium客户端或者cucumber的测试也可以很容易的在该环境中运行起来。