grunt-contrib-connect middleware redirect function. easy to use make fake api for front-end. This sample used yeoman generator gruntfile.
- download
redirect.js
to project root. - edit
Gruntfile.js
var redirect = require('./redirect');
module.exports = { | |
host: process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1', | |
// port: process.env.PORT || 1337, | |
port: process.env.OPENSHIFT_NODEJS_PORT || 80, | |
// environment: process.env.NODE_ENV || 'development' | |
// environment: process.env.NODE_ENV || 'production' | |
environment: process.env.NODE_ENV || 'development' |
/** | |
* Local environment settings | |
* | |
* While you're developing your app, this config file should include | |
* any settings specifically for your development computer (db passwords, etc.) | |
* When you're ready to deploy your app in production, you can use this file | |
* for configuration options on the server where it will be deployed. | |
* | |
* | |
* PLEASE NOTE: |
# Load balancer configuration | |
upstream exampleApp { | |
# Directs to the process with least number of connections. | |
least_conn; | |
# One failed response will take a server out of circulation for 20 seconds. | |
server 127.0.0.1:10080 fail_timeout=20s; | |
#server 127.0.0.1:10081 fail_timeout=20s; | |
#server 127.0.0.1:10082 fail_timeout=20s; | |
#server 127.0.0.1:10083 fail_timeout=20s; |
(function($){ | |
var I18N = function(){}; | |
I18N.prototype.lng = function lng() { | |
return $('html').attr('lang').toUpperCase() || 'EN-US'; | |
}; | |
I18N.prototype.t = I18N.prototype.translate = function translate(key) { | |
if(!key) { | |
return this; |
javascript:!function(d,script){script=d.createElement("script"),script.type="text/javascript",script.async=!0,script.onload=function(){return TogetherJS(this),!1},script.src="https://togetherjs.com/togetherjs-min.js",d.getElementsByTagName("head")[0].appendChild(script)}(document); |
#!/bin/bash | |
sudo apt-get remove phantomjs | |
sudo unlink /usr/local/bin/phantomjs | |
sudo unlink /usr/local/share/phantomjs | |
sudo unlink /usr/bin/phantomjs | |
cd /usr/local/share |
#!/bin/sh | |
echo "Deploy beign" | |
# 設定 nodejs 環境(如果是用 nvm 管理 nodejs 才需要) | |
. "$HOME/.nvm/nvm.sh" | |
# 設定 project 路徑 | |
export PROJECT_DIR=$HOME/PROJECT |
// | |
// LoadingView.h | |
// | |
// | |
// Created by Isken on 3/16/11. | |
// Copyright 2011 Isken. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
// http://40era.com/2641/ | |
var calTW = function(salary, mo) { | |
var range = { | |
r1: { | |
off: 0, | |
tax: 3, | |
range: 1500 | |
}, | |
r2: { | |
off: 105, |