I hereby claim:
- I am lgh06 on github.
- I am lgh06 (https://keybase.io/lgh06) on keybase.
- I have a public key ASDmLfMm573JbUC__Cmf4c8vKpuAcVQbCzIaDoUSqYkhJgo
To claim this, I am signing this object:
| -----BEGIN PGP PUBLIC KEY BLOCK----- | |
| Version: GnuPG v2 | |
| mQENBFgTBlUBCACi5g8nS6cj3xY2YdDJMQWerK9gczhSmFsH/lRCx/qc/4rwMVmX | |
| LRT8bQC9iHL++F0HWfMu7MXeUGVDtPKDLLy7OZH7aN2mtr0b+xBmQrNT9SYsmGJq | |
| R+mq1jgD6p3z8DVAOHcYjG06JQhVXBW8h/s4UrXOidwltSqX6T0LSj01n4PLWAHO | |
| 4eO/u+tgBWWzls5o4fNqF6QKvxW/B3naglJ+DbdgXcxpjAS+b4h87KEDNn8T7xjk | |
| AWdI6kuZZ2P0ayU1RUuY2u93O0dQtxbI4QQN5doJp1C63CT4NyrahNRGO7hgtnpK | |
| zAZ51AB5q/sZgs2YYwLoSZ3Q38VJuBiiVLVFABEBAAG0GEdlaHVhbiBMaXUgPGhu | |
| bmtAcXEuY29tPokBOQQTAQgAIwUCWBMGVQIbAwcLCQgHAwIBBhUIAgkKCwQWAgMB |
I hereby claim:
To claim this, I am signing this object:
| # | |
| # The default server | |
| # | |
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| server_name _; | |
| root /usr/share/nginx/html; |
| var fs = require('fs') | |
| var trie = {} | |
| var tempWords = {}; | |
| fs.readFile('./text.txt',function(err,callback){ | |
| var str = callback.toString(); | |
| str = str.replace(/[^\u4e00-\u9fa5]/g,'@'); | |
| str = str.replace(/@+/g,' ') | |
| split(str); |
| (function(window) { | |
| var fn = function () { | |
| var s = document.createElement('script'); | |
| s.src = './js/client.js'; | |
| s.async = true; | |
| s.defer = true; | |
| document.body.appendChild(s); | |
| } | |
| document.addEventListener('DOMContentLoaded', fn); |
uglifyjs kankan_click_pv_src.js --support-ie8 -o kankan_click_pv.js -c pure_getters=true,unused=false,dead_code=false,pure_funcs=['getCookie'],drop_console=true,drop_debugger=true
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');Those suck for maintenance and they're ugly.
| //hook console.log to web page. | |
| var oldlog = console.log; | |
| console.log = function() { | |
| oldlog.apply(console, arguments); | |
| let arr = Array.from(arguments); | |
| let keys = arr.keys(); | |
| for (let v of keys) { | |
| if(typeof arr[v] === 'object'){ | |
| arr[v] = JSON.stringify(arr[v]); |
| module.exports = { | |
| "env": { | |
| "browser": true, | |
| "commonjs": true, | |
| "es6": true | |
| }, | |
| "extends": "eslint:recommended", | |
| "parserOptions": { | |
| "sourceType": "module" | |
| }, |
| var rawframe = document.createElement('iframe'); | |
| document.body.appendChild(rawframe) | |
| var framedoc = rawframe.contentDocument; | |
| if (!framedoc && rawframe.contentWindow) { | |
| framedoc = rawframe.contentWindow.document; | |
| } | |
| var script = document.createElement('script'); | |
| script.type = "text/javascript"; | |
| script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"; | |
| framedoc.body.appendChild(script); |