#Mac SSH or VPN 设置教程
This guide is written by @slaindev, the text editor is Mou
specially for @neolau & @ dinosaurshmily
##SSH 设置篇
###工具准备
| #user nobody; | |
| worker_processes 4; | |
| events { | |
| worker_connections 10240; | |
| } | |
| http { | |
| include mime.types; | |
| default_type application/octet-stream; |
#Mac SSH or VPN 设置教程
This guide is written by @slaindev, the text editor is Mou
specially for @neolau & @ dinosaurshmily
##SSH 设置篇
###工具准备
| /** | |
| ** 加法函数,用来得到精确的加法结果 | |
| ** 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。 | |
| ** 调用:accAdd(arg1,arg2) | |
| ** 返回值:arg1加上arg2的精确结果 | |
| **/ | |
| function accAdd(arg1, arg2) { | |
| var r1, r2, m, c; | |
| try { | |
| r1 = arg1.toString().split(".")[1].length; |
| #!/usr/bin/env python | |
| import simplejson | |
| import logging | |
| import random | |
| import re | |
| import datetime | |
| import string | |
| import time | |
| import sys | |
| import urllib |
| #import <UIKit/UIKit.h> | |
| #import <ImageIO/ImageIO.h> | |
| #import <MobileCoreServices/MobileCoreServices.h> | |
| static UIImage *frameImage(CGSize size, CGFloat radians) { | |
| UIGraphicsBeginImageContextWithOptions(size, YES, 1); { | |
| [[UIColor whiteColor] setFill]; | |
| UIRectFill(CGRectInfinite); | |
| CGContextRef gc = UIGraphicsGetCurrentContext(); | |
| CGContextTranslateCTM(gc, size.width / 2, size.height / 2); |
| cd ~ | |
| sudo wget http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.2.1.v20140609.tar.gz -O jetty.tar.gz | |
| tar -xf jetty.tar.gz | |
| rm -rf jetty.tar.gz | |
| mv jetty-* jetty | |
| sudo /usr/sbin/useradd jetty | |
| sudo mv jetty /srv/ |
| license: gpl-3.0 |
| var myApp = angular.module('myApp').service('CordovaNetwork', ['$ionicPlatform', '$q', function($ionicPlatform, $q) { | |
| // Get Cordova's global Connection object or emulate a smilar one | |
| var Connection = window.Connection || { | |
| "CELL" : "cellular", | |
| "CELL_2G" : "2g", | |
| "CELL_3G" : "3g", | |
| "CELL_4G" : "4g", | |
| "ETHERNET" : "ethernet", | |
| "NONE" : "none", | |
| "UNKNOWN" : "unknown", |
mathclub是最近做的一个个人项目,帮助考SAT的同学通过在线做题、回顾、问答提高成绩。用户功能有:计次/计时做题、成绩单、错题分布、错题回顾、提问、汇总以及注册登录。管理后台主要是题库管理、学员管理、成绩单管理、问题回复。怎么看都像学校里的课设,的确项目本身并不出奇,开发上选用的一些方案或许更有意思。
整个项目一个人从产品需求、原型设计、前后端开发到部署历时2周左右。可以从截图上感受一下:
技术选型上服务端是Node.js,应用框架选了老牌的Express(4.x变化挺大不少中间件都废了),数据服务用的是MongoLab(MongoDB的云服务平台),图片上传用的是又拍云,程序部署在Nodejitsu上。模板引擎没选主流的Jade或ejs,而是用Express React Views它实现了在服务端渲染React组件。前端框架是用React,这次有意想追求前后端全部组件化的组织。之前是用Webpack实现CommonJS模块打包,这次用Browserify配置更简单,它有丰富的transform很赞,其中的reactify转换React的JSX很完美。CSS用Sass+autoprefixer让人省心。将这一切串起来的自动构建工具是Gulp。我其实崇尚用最精简的工具组合开发,上述组合在我看来比较精简了。(帖纸留念)
![image](http://satexam.b0.upaiyu
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents