This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { | |
function c() { | |
var e = document.createElement("link"); | |
e.setAttribute("type", "text/css"); | |
e.setAttribute("rel", "stylesheet"); | |
e.setAttribute("href", f); | |
e.setAttribute("class", l); | |
document.body.appendChild(e) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//闭包执行一个立即定义的匿名函数 | |
!function(factory) { | |
//factory是一个函数,下面的koExports就是他的参数 | |
// Support three module loading scenarios | |
if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') { | |
// [1] CommonJS/Node.js | |
// [1] 支持在module.exports.abc,或者直接exports.abc | |
var target = module['exports'] || exports; // module.exports is for Node.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ////////////////////////////// | |
* webpack 1.x: | |
* ////////////////////////////// | |
*/ | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
loaders: ['babel-loader'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<scroller> | |
<text>{{constr}}</text> | |
</scroller> | |
</template> | |
<script> | |
module.exports = { | |
data () { | |
return { constr: 'list' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 实现一个nodejs的Master-Worker的小程序,要求: | |
* 1. Master维护与cpu核数相同的Worker的数量; | |
* 2. Master接收到Worker的disconnect消息时,重启新的Worker进程; | |
* 3. Worker监听1024端口并输出“Hello World”; | |
* 4. 在Worker遇到uncaughtException时,通知Master进程并等待3s后退出 | |
*/ | |
var os = require('os'), | |
cluster = require('cluster'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { rollup } from 'rollup' | |
import postcss from 'rollup-plugin-postcss' | |
import json from 'rollup-plugin-json' | |
import eslint from 'rollup-plugin-eslint' | |
import nodeResolve from 'rollup-plugin-node-resolve' | |
import commonjs from 'rollup-plugin-commonjs' | |
import buble from 'rollup-plugin-buble' | |
const pkg = require('../package.json') | |
const version = pkg.version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<scroller class="list" append="node"> | |
<refresh class="refresh-view" display="{{refresh_display}}" onrefresh="onrefresh"> | |
<loading-indicator style="height:60;width:60" ></loading-indicator> | |
<text class="refresh-arrow" style="text-align: center; color:rgb(238, 162, 54)" if="{{(refresh_display==='hide')}}">Pull To Refresh</text> | |
</refresh> | |
<div class="section" repeat="{{sections}}"> | |
<div class="header"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git filter-branch --env-filter ' | |
an="$GIT_AUTHOR_NAME" | |
am="$GIT_AUTHOR_EMAIL" | |
cn="$GIT_COMMITTER_NAME" | |
cm="$GIT_COMMITTER_EMAIL" | |
if [ "$GIT_COMMITTER_EMAIL" = "old email" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// register the interceptor as a service | |
$provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) { | |
return { | |
// optional method | |
'request': function(config) { | |
// do something on success | |
return config || $q.when(config); | |
}, | |
// optional method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |
NewerOlder