Skip to content

Instantly share code, notes, and snippets.

@happyguohua
happyguohua / gulp-file
Created August 11, 2015 07:13
less without gulp-less plugin
var buildLatest = process.env.EVC15_BUILD_LATEST;
var path = require('path'),
util = require('util'),
gulp = require('gulp'),
replace = require('gulp-replace'),
gulpUtil = require('gulp-util'),
requirejs = require('requirejs'),
less = require('less'),
fs = require('fs'),
var https = require('https'),
express = require('express'),
app = express();
var root = __dirname + '/dist/latest';
var bower_components = __dirname + '/bower_components/';
app.get('/', function(req, res) {
res.sendFile(__dirname + '/index.dev.html');
});
var ASQ = require('asynquence'),
fs = require('fs'),
target = './Flatten/';
ASQ(target)
.then(function(done, folder) {
fs.readdir(folder, function(err, files) {
if (err) done.fail('read dir error');
done(files);
})
@happyguohua
happyguohua / create release branch
Created June 8, 2015 09:38
create releae branch by command line
var spawn = require('child_process').spawn,
fs = require('fs'),
commandArray = [
'git help',
'git init',
'git remote add origin ssh://git@stash.englishtown.com:7999/comm/evc-ui-library.git',
'git fetch',
'git branch -r'
];
var spawn = require('child_process').spawn,
fs = require('fs'),
commandArray = [
'git help',
'git init',
'git remote add origin ssh://git@stash.englishtown.com:7999/comm/evc-ui-library.git',
'git fetch',
'git branch -r'
];
@happyguohua
happyguohua / navigator.userAgent
Created May 28, 2015 01:07
get os platform from browser
/*
* will return one of the following value
* [Windows Phone] // windows phone
* [Android] // Android device
* [Linux] // Centos, Ubuntu, Amazon Kindle...
* [iOS] // ipad, iphone
* [OS X] // macbook
* [Windows] // Windows
* [''] // others
*/
<!doctype html>
<html class="gud evc-component">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EVC PLATFORM GL</title>
</head>
<body>
<script src="bower_components/boomerang/boomerang.js"></script>
<script src="bower_components/boomerang/plugins/bw.js"></script>
<!doctype html>
<html class="gud evc-component">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EVC PLATFORM GL</title>
</head>
<body>
<script src="bower_components/boomerang/boomerang.js"></script>
<script src="bower_components/boomerang/plugins/bw.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Loading...</title>
<style>
html,
body {
padding: 0;
margin: 0;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Loading...</title>
<style>
html,
body {
padding: 0;
margin: 0;