├── .gitignore ├── README.md ├── favicon.ico ├── index.html ├── markppt ├── index.html ├── index.md └── ppt_ │ ├── animate.min.css │ ├── arrow_up.png │ ├── censorship.worker.js │ ├── highlight.pack.js │ ├── highlight.railscasts.css │ ├── icon_400x400.png │ ├── jquery.min.js │ ├── jquery.waitforimages.min.js │ ├── marked.min.js │ ├── oops.md │ ├── ppt.css │ ├── ppt.js │ ├── purify.min.js │ └── randomColor.js ├── p ├── 2014 │ ├── 10 │ │ ├── QQ图片20141022210533.jpg │ │ ├── QQ图片20141022210537.jpg │ │ ├── QQ图片20141022214120.jpg │ │ ├── _house-clean.md │ │ └── free-your-html-body-tags.md │ ├── 11 │ │ └── self-indentification.md │ ├── 12 │ │ └── test-on-javascript.md │ ├── 03 │ │ ├── book.png │ │ └── mom-and-textbooks.md │ ├── 04 │ │ └── keeping-determined.md │ ├── 05 │ │ ├── DSC07948.JPG │ │ ├── DSC07978.JPG │ │ ├── _focus-or-radiate.md │ │ ├── lift.png │ │ ├── markdown-talk.md │ │ ├── mom-1.jpg │ │ ├── mom-3.jpg │ │ ├── mom-4.jpg │ │ ├── mothers-day.md │ │ ├── my-resume.md │ │ ├── out-of-campus.md │ │ ├── photo.jpg │ │ ├── step-by-step.md │ │ ├── sun.png │ │ └── taught-by-hong.md │ ├── 06 │ │ ├── 20140605_115154.jpg │ │ ├── 20140605_123257.jpg │ │ ├── _clean-qq-groups.md │ │ ├── _keep-up-with-friends.md │ │ ├── _my-father.md │ │ ├── eol-wyu-cn-xss.md │ │ ├── mom │ │ │ ├── crosshair.png │ │ │ ├── game │ │ │ │ ├── AIDriver.js │ │ │ │ ├── Driver.js │ │ │ │ ├── Missile.js │ │ │ │ ├── Ship.js │ │ │ │ ├── Sound.js │ │ │ │ ├── Station.js │ │ │ │ ├── Unit.js │ │ │ │ ├── UserDriver.js │ │ │ │ ├── World.js │ │ │ │ └── main.js │ │ │ ├── index.html │ │ │ ├── lib │ │ │ │ ├── class.js │ │ │ │ ├── jquery.min.js │ │ │ │ ├── locker.js │ │ │ │ ├── stats.min.js │ │ │ │ └── three.min.js │ │ │ ├── photos │ │ │ │ ├── 00.jpg │ │ │ │ ├── 01.jpg │ │ │ │ ├── 02.jpg │ │ │ │ ├── 03.jpg │ │ │ │ ├── 04.jpg │ │ │ │ └── 05.jpg │ │ │ ├── sounds │ │ │ │ ├── 莫扎特 - 小星星变奏曲.mp3 │ │ │ │ └── 莫扎特 - 小星星变奏曲.ogg │ │ │ ├── style.css │ │ │ └── textures │ │ │ │ ├── bedrock.png │ │ │ │ ├── blockDiamond.png │ │ │ │ ├── bluewool.png │ │ │ │ ├── brick.png │ │ │ │ ├── cobblestone.png │ │ │ │ ├── crate.png │ │ │ │ ├── diamond.png │ │ │ │ ├── dirt.png │ │ │ │ ├── glowstone.png │ │ │ │ ├── grass.png │ │ │ │ ├── grass_dirt.png │ │ │ │ ├── ice.png │ │ │ │ ├── icons │ │ │ │ ├── bluewoolicon.png │ │ │ │ ├── brickicon.png │ │ │ │ ├── cobblestoneicon.png │ │ │ │ ├── diamondicon.png │ │ │ │ ├── glowstoneicon.png │ │ │ │ ├── netherrackicon.png │ │ │ │ ├── obsidianicon.png │ │ │ │ ├── plankicon.png │ │ │ │ ├── redwoolicon.png │ │ │ │ └── whitewoolicon.png │ │ │ │ ├── netherrack.png │ │ │ │ ├── obsidian.png │ │ │ │ ├── opaque.png │ │ │ │ ├── plank.png │ │ │ │ ├── redwool.png │ │ │ │ └── whitewool.png │ │ └── myotee-talk.md │ ├── 08 │ │ ├── IMG_20140824_150017.jpg │ │ ├── e6c88c821a944f8da86cd899a44e73ad.jpg │ │ ├── lagou-resume.md │ │ ├── lagou.css │ │ ├── mmexport1408888984123.jpg │ │ ├── profile_square.png │ │ └── weekend-01.md │ └── 09 │ │ ├── bug │ │ ├── close.png │ │ ├── gulp-plugins.png │ │ ├── notification.png │ │ ├── reference.png │ │ └── thanks.png │ │ └── gulp-eol-bug.md ├── 2015 │ ├── 01 │ │ ├── fs-auth.md │ │ ├── fs-auth │ │ │ ├── auth.png │ │ │ ├── decrypt.png │ │ │ ├── encrypt.png │ │ │ ├── overview.png │ │ │ └── shift.png │ │ ├── use-n0gx.md │ │ └── why-no-semicolon.md │ ├── 03 │ │ ├── _memory-bgm.md │ │ └── to-jayin.md │ ├── 04 │ │ └── _respdesign │ │ │ ├── 1min-song-md.png │ │ │ ├── 1min-song-xs.png │ │ │ ├── 711.jpg │ │ │ ├── bec-boss-sm.png │ │ │ ├── bec-boss-sm1.png │ │ │ ├── bec-boss-xs.png │ │ │ ├── bec-caselist-md.png │ │ │ ├── bec-caselist-sm.png │ │ │ ├── bec-caselist-xs.png │ │ │ ├── blog-post-md.png │ │ │ ├── blog-post-xs.png │ │ │ ├── gulpfile.js │ │ │ ├── index.md │ │ │ ├── index.md.html │ │ │ ├── ppt_ │ │ │ ├── animate.min.css │ │ │ ├── jquery.min.js │ │ │ ├── ppt.css │ │ │ └── ppt.js │ │ │ ├── screens.png │ │ │ └── silent-screenshots.png │ ├── 05 │ │ ├── _channel-dev-together-01 │ │ │ ├── index.md │ │ │ ├── maxwidth-0.png │ │ │ ├── maxwidth-1.png │ │ │ ├── scale08-0.jpg │ │ │ ├── scale08-1.jpg │ │ │ ├── scale09-0.jpg │ │ │ ├── scale09-1.jpg │ │ │ ├── tablecell-0.png │ │ │ ├── tablecell-01.png │ │ │ ├── verticalmid-0.png │ │ │ ├── verticalmid-01.png │ │ │ ├── verticalmid-10.png │ │ │ ├── verticalmid-11.png │ │ │ ├── verticalmid-12.png │ │ │ ├── verticalmid-13.png │ │ │ ├── verticaltop-10.png │ │ │ ├── verticaltop-11.png │ │ │ └── verticaltop-12.png │ │ └── silent-one-year-old │ │ │ ├── chang.jpg │ │ │ ├── derek.jpg │ │ │ ├── index.md │ │ │ ├── jacson.jpg │ │ │ ├── jayden.png │ │ │ ├── jayin.jpg │ │ │ ├── silent.png │ │ │ └── todd.gif │ ├── 06 │ │ ├── 2014-11-24 141334.jpg │ │ ├── 800-600.46d7d7c6174f9db0faa20f13ac4013c95b29c778_stxt_63_stxt1_t.d0c6ba.jpg │ │ ├── _about-acadamy.md │ │ ├── campus.jpg │ │ ├── graduation-thanks.md │ │ ├── iPad_Photo_20141123095701SJ1K.JPG │ │ ├── iPad_Photo_201506060404147EL8.JPG │ │ ├── qsbk_dept_app.jpg │ │ └── qsbk_office.jpg │ └── 08 │ │ ├── coding-style.md │ │ └── nodejs-talk │ │ ├── Music.jpg │ │ ├── army.png │ │ ├── fanyi.png │ │ ├── friends.png │ │ ├── galaxy_02.png │ │ ├── gulp-app.png │ │ ├── gulpeol.jpg │ │ ├── icon1_2.png │ │ ├── index.md │ │ ├── markppt.jpg │ │ ├── markppt_02.jpg │ │ ├── monkey.jpg │ │ ├── news.png │ │ ├── nodejs1.png │ │ ├── npm.jpg │ │ ├── pm2.jpg │ │ ├── qqlog.png │ │ ├── threejs.jpg │ │ └── ufo.jpg ├── 2016 │ ├── 01 │ │ ├── new-year-2016.md │ │ ├── nwjs-code-protection │ │ │ ├── flow.png │ │ │ ├── index.md │ │ │ ├── nwjs.png │ │ │ ├── shield.png │ │ │ ├── smile.png │ │ │ ├── thumbup.png │ │ │ └── wtf.png │ │ └── tabs.png │ └── 08 │ │ ├── silent-talk.md │ │ ├── 屏幕快照 2016-08-02 下午5.46.40.png │ │ └── 屏幕快照 2016-08-02 下午6.35.12.png ├── 2017 │ ├── 03 │ │ └── hack-google-translate │ │ │ ├── chat-history-0.png │ │ │ ├── chat-history-1.png │ │ │ ├── chat-history-2.png │ │ │ ├── debugger.png │ │ │ ├── event-listeners.png │ │ │ ├── hack-code.png │ │ │ ├── index.md │ │ │ ├── injure.mp3 │ │ │ ├── kill.mp3 │ │ │ ├── spacewar.png │ │ │ ├── speaking-feature.png │ │ │ └── welcome.mp3 │ ├── 06 │ │ └── mobile-webapp-issues.md │ └── 07 │ │ └── sentry-sourcemap-guide.md ├── 2018 │ ├── 06 │ │ ├── macbook-recovery │ │ │ ├── error-01.jpeg │ │ │ ├── error-02.jpeg │ │ │ ├── index.md │ │ │ ├── jd-service-01.png │ │ │ ├── jd-service-02.png │ │ │ ├── jd-service-03.png │ │ │ ├── recovery-01.jpeg │ │ │ ├── recovery-02.jpeg │ │ │ ├── recovery-03.jpeg │ │ │ ├── recovery-04.jpeg │ │ │ └── youtube-01.png │ │ ├── ry-deno-scandal │ │ │ ├── index.md │ │ │ └── ppt-light-table-2.png │ │ └── uigen-lib │ │ │ ├── index.md │ │ │ └── ppt-light-table.png │ └── 08 │ │ └── service-platforms │ │ ├── index.md │ │ └── light-table.png ├── 2019 │ ├── 03 │ │ ├── el-progress-precision-fix.md │ │ ├── found-nodemon.png │ │ ├── found-parent.png │ │ ├── port-in-use-debug.md │ │ ├── progress-0.png │ │ ├── progress-1.png │ │ └── restart-count.png │ ├── 04 │ │ ├── custom-select-preview.png │ │ ├── element-custom-select.md │ │ └── element.jpeg │ └── 05 │ │ ├── mongodb.jpeg │ │ └── topology-was-destroyed.md ├── 2020 │ └── 04 │ │ ├── double.jpeg │ │ ├── single.jpeg │ │ ├── use-separated-column.md │ │ └── use-split-table.md ├── 2022 │ └── 09 │ │ ├── WX20220927-134112.png │ │ ├── WX20220927-134431.png │ │ ├── WX20220927-155434.png │ │ ├── WX20220927-160316.png │ │ ├── WX20220927-164233.png │ │ ├── WX20220927-164651.png │ │ ├── WX20220927-222427.png │ │ ├── WX20220928-175618.png │ │ ├── WX20220928-180550.png │ │ ├── blog-setup-via-github-fork.md │ │ ├── wtf-is-that-mac-icloud-handoff-en.md │ │ └── wtf-is-that-mac-icloud-handoff.md ├── 2023 │ └── 09 │ │ ├── ka2ab.jpg │ │ ├── maxresdefault.jpg │ │ └── symlinks-vs-hard-links.md ├── aboutme.md ├── avatar.jpg ├── collection.md ├── collection │ ├── _love-poet.md │ ├── friends-quotes.md │ └── hk-capital.md ├── diary.md ├── ducks │ ├── 2010072611150872.gif │ ├── 2010072611151106.gif │ └── 2010072611151148.gif ├── fork.png ├── github.png ├── projects.md ├── projects │ ├── auto-favicon-zh.md │ ├── auto-favicon.md │ ├── emshop │ │ ├── Screenshot_2014-08-10-14-57-48.jpeg │ │ ├── Screenshot_2014-08-10-14-58-54.jpeg │ │ ├── Screenshot_2014-08-10-15-00-13.jpeg │ │ ├── Screenshot_2014-08-10-15-01-01.jpeg │ │ ├── Screenshot_2014-08-10-15-02-35.jpeg │ │ ├── Screenshot_2014-08-10-15-03-05.jpeg │ │ ├── Screenshot_2014-08-10-15-03-38.jpeg │ │ ├── Screenshot_2014-08-10-15-04-06.jpeg │ │ └── index.md │ ├── github-badge.svg │ ├── gitter-badge.svg │ ├── ideas-2019-2020 │ │ └── index.md │ ├── jmsis │ │ ├── 01.jpg │ │ ├── 02.jpg │ │ ├── 03.jpg │ │ ├── 04.jpg │ │ ├── 05.jpg │ │ ├── 06.jpg │ │ └── index.md │ ├── markppt │ │ ├── README.md │ │ ├── artwork │ │ │ └── icon_400x400.png │ │ └── screenshots │ │ │ ├── 2015-04-10 23.17.37.png │ │ │ ├── 2015-04-11 02.09.47.png │ │ │ ├── 20150901233430.png │ │ │ ├── 20150901233453.png │ │ │ ├── 20150901234930.png │ │ │ └── 20150901235103.png │ ├── mshop │ │ ├── Screenshot_2014-04-13-07-55-21.jpeg │ │ ├── Screenshot_2014-04-13-07-56-00.jpeg │ │ ├── Screenshot_2014-04-13-07-56-07.jpeg │ │ ├── Screenshot_2014-04-13-07-56-33.jpeg │ │ ├── Screenshot_2014-04-13-07-57-44.jpeg │ │ ├── Screenshot_2014-04-13-07-57-55.jpeg │ │ ├── Screenshot_2014-04-13-07-58-36.jpeg │ │ ├── Screenshot_2014-04-13-07-59-27.jpeg │ │ ├── Screenshot_2014-04-13-08-03-28.jpeg │ │ ├── Screenshot_2014-04-13-08-03-41.jpeg │ │ ├── Screenshot_2014-04-13-08-03-47.jpeg │ │ ├── Screenshot_2014-04-13-08-04-05.jpeg │ │ ├── Screenshot_2014-04-13-08-04-25.jpeg │ │ ├── Screenshot_2014-04-13-08-04-31.jpeg │ │ ├── Screenshot_2014-04-13-08-05-10.jpeg │ │ ├── Screenshot_2014-04-13-08-07-54.jpeg │ │ ├── Screenshot_2014-04-13-08-08-42.jpeg │ │ ├── Screenshot_2014-04-13-08-17-16.jpeg │ │ ├── Screenshot_2014-04-13-08-17-27.jpeg │ │ ├── Screenshot_2014-04-13-08-17-49.jpeg │ │ ├── Screenshot_2014-04-13-08-17-57.jpeg │ │ ├── Screenshot_2014-04-13-08-18-04.jpeg │ │ └── index.md │ ├── react-drag-sizing │ │ ├── README.md │ │ └── demo.gif │ ├── silent │ │ ├── README.md │ │ └── pic │ │ │ ├── Screenshot_from_2014-05-08_01-43-18.png │ │ │ ├── Screenshot_from_2014-05-08_01-48-37.png │ │ │ ├── Screenshot_from_2014-05-08_01-50-42.png │ │ │ ├── Screenshot_from_2014-05-08_01-56-27.png │ │ │ ├── si1ent.png │ │ │ └── tshirt-x360.png │ ├── silent_2.0 │ │ ├── README.md │ │ ├── WX20220927-173925.png │ │ └── WechatIMG533.png │ ├── siyuan │ │ ├── Screenshot_2014-03-22-23-21-48.jpeg │ │ ├── Screenshot_2014-03-22-23-22-01.jpeg │ │ ├── Screenshot_2014-03-22-23-22-10.jpeg │ │ ├── Screenshot_2014-03-22-23-22-37.jpeg │ │ ├── Screenshot_2014-03-22-23-23-00.jpeg │ │ ├── Screenshot_2014-03-22-23-23-08.jpeg │ │ ├── Screenshot_2014-03-22-23-23-14.jpeg │ │ ├── Screenshot_2014-03-22-23-23-36.jpeg │ │ ├── Screenshot_2014-03-22-23-24-02.jpeg │ │ ├── Screenshot_2014-03-22-23-24-57.jpeg │ │ ├── Screenshot_2014-03-22-23-25-13.jpeg │ │ ├── Screenshot_2014-03-22-23-26-09.jpeg │ │ └── index.md │ ├── vue-at │ │ ├── README.md │ │ ├── WechatIMG1.jpeg │ │ └── WechatIMG2.jpeg │ ├── website-badge.svg │ ├── wxbot │ │ ├── README.md │ │ └── screenshot.jpeg │ ├── wxchangba │ │ ├── README.md │ │ └── pic │ │ │ ├── admin-login.png │ │ │ ├── admin-songlist-0.png │ │ │ ├── admin-songlist-1.png │ │ │ ├── admin-songlist-2.png │ │ │ ├── md-song-0.png │ │ │ ├── md-song-1.png │ │ │ ├── md-songlist-0.png │ │ │ ├── md-songlist-1.png │ │ │ ├── wxpub-0.png │ │ │ ├── wxpub-1.png │ │ │ ├── xs-playlist-0.png │ │ │ ├── xs-playlist-1.png │ │ │ ├── xs-song-0.png │ │ │ ├── xs-song-1.png │ │ │ ├── xs-songlist-0.png │ │ │ ├── xs-songlist-1.png │ │ │ ├── xs-wxrecord-0.png │ │ │ ├── xs-wxrecord-1.png │ │ │ ├── 时序图-公众号语音.png │ │ │ ├── 时序图-微信网页接口授权.png │ │ │ ├── 时序图-网页录音-详细.png │ │ │ └── 用例图-详细.png │ ├── wyu-sing │ │ ├── Screenshot_2014-03-26-20-12-22.jpeg │ │ ├── Screenshot_2014-03-26-20-12-29.jpeg │ │ ├── Screenshot_2014-03-26-20-12-44.jpeg │ │ ├── Screenshot_2014-03-26-20-12-53.jpeg │ │ ├── Screenshot_2014-03-26-20-13-03.jpeg │ │ ├── Screenshot_2014-03-26-20-13-22.jpeg │ │ ├── Screenshot_2014-03-26-20-14-11.jpeg │ │ └── index.md │ ├── xstu │ │ ├── README.md │ │ └── shot │ │ │ ├── 0-login.jpg │ │ │ ├── 1-profile.jpg │ │ │ ├── 2-courses.jpg │ │ │ ├── 3-scores-1.jpg │ │ │ ├── 3-scores-2.jpg │ │ │ ├── 3-scores.jpg │ │ │ └── frameless.jpg │ └── yjjapp │ │ ├── README.md │ │ └── pic │ │ ├── 0-open.png │ │ ├── 1-join.png │ │ ├── 2-files.png │ │ ├── 3-voting.png │ │ ├── 4-qna.png │ │ ├── 5-lottery.png │ │ ├── 6-pros.png │ │ └── 7-plans.png ├── sidebar.md ├── tech.md ├── tweets.md └── weekly │ ├── 170127 │ ├── index.md │ └── newyear.jpg │ ├── 150828.md │ ├── 150904.md │ ├── 150911.md │ ├── 151002.md │ ├── 151016.md │ ├── 151030.md │ ├── 151120.md │ ├── 160109.md │ ├── 160227.md │ ├── 160312.md │ ├── 160326.md │ ├── 160409.md │ ├── 160430.md │ ├── 160514.md │ ├── 160604.md │ ├── 160625.md │ ├── 160716.md │ ├── 160903.md │ ├── 161015.md │ ├── 161029.md │ ├── 161127.md │ ├── 170319.md │ ├── 170430.md │ ├── 170528.md │ ├── 170625.md │ ├── 170730.md │ ├── 170916.md │ ├── 171028.md │ ├── 171216.md │ ├── 180210.md │ ├── 180403.md │ ├── 180505.md │ ├── 180721.md │ ├── 180826.md │ ├── 181028.md │ ├── 181230.md │ ├── 190112.md │ ├── 190126.md │ ├── 190216.md │ ├── 190420.md │ ├── 190518.md │ ├── 190622.md │ ├── 190814.md │ ├── 220225.md │ ├── 220420.md │ ├── 220530.md │ ├── 220802.md │ ├── 220821.md │ ├── 220922.md │ ├── 221019.md │ └── index.md └── vendor ├── blog.css ├── blog.js ├── highlight.pack.js ├── jquery-1.11.1.min.js ├── lodash-4.17.21.min.js ├── marked-0.3.2.min.js ├── pace-1.2.4.min.js └── zenburn.css /.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.log 3 | .idea 4 | node_modules 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fritx' Blog 2 | 3 | > Life is short, I use JS 4 | 5 | Check it out: 6 | 7 | Built with [silent](https://github.com/fritx/silent) 8 | 9 | Hosted by [Github Pages](https://pages.github.com/) 10 | 11 | --- 12 | 13 | Regularly Building: 14 | 15 | ```sh 16 | # Icon `` can not be rendered on some Android devices 17 | sed -i '' 's//🍎/g' p/**/*.md 18 | ``` 19 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/favicon.ico -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | 39 | 40 |
41 |
42 |
43 | 44 | 45 |
46 |
47 |
48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /markppt/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /markppt/index.md: -------------------------------------------------------------------------------- 1 | # 这里是MarkPPT 2 | 3 | 你可以尝试在网址上添加`?url=xxxx.md`(你的markdown网址) 4 | 5 | 如:https://bec.today/markppt/?url=https://raw.githubusercontent.com/fritx/markppt/dev/examples/mytalk/talk.md 6 | 7 | --- 8 | 9 | 如GitHub访问不通,这是备用网址:https://bec.today/markppt/?url=https://bec.today/markppt/examples/mytalk/talk.md 10 | 11 | 注意:你的markdown网址需要时同源的,或者开启CORS跨域支持 12 | 13 | --- 14 | 15 | 16 | 17 | 了解更多请点击:https://blog.fritx.me/?projects/markppt/ 18 | -------------------------------------------------------------------------------- /markppt/ppt_/arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/markppt/ppt_/arrow_up.png -------------------------------------------------------------------------------- /markppt/ppt_/icon_400x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/markppt/ppt_/icon_400x400.png -------------------------------------------------------------------------------- /markppt/ppt_/jquery.waitforimages.min.js: -------------------------------------------------------------------------------- 1 | /*! waitForImages jQuery Plugin 2015-06-02 */ 2 | !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){var b="waitForImages";a.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage","cursor"],hasImageAttributes:["srcset"]},a.expr[":"]["has-src"]=function(b){return a(b).is('img[src][src!=""]')},a.expr[":"].uncached=function(b){return a(b).is(":has-src")?!b.complete:!1},a.fn.waitForImages=function(){var c,d,e,f=0,g=0,h=a.Deferred();if(a.isPlainObject(arguments[0])?(e=arguments[0].waitForAll,d=arguments[0].each,c=arguments[0].finished):1===arguments.length&&"boolean"===a.type(arguments[0])?e=arguments[0]:(c=arguments[0],d=arguments[1],e=arguments[2]),c=c||a.noop,d=d||a.noop,e=!!e,!a.isFunction(c)||!a.isFunction(d))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var i=a(this),j=[],k=a.waitForImages.hasImageProperties||[],l=a.waitForImages.hasImageAttributes||[],m=/url\(\s*(['"]?)(.*?)\1\s*\)/g;e?i.find("*").addBack().each(function(){var b=a(this);b.is("img:has-src")&&j.push({src:b.attr("src"),element:b[0]}),a.each(k,function(a,c){var d,e=b.css(c);if(!e)return!0;for(;d=m.exec(e);)j.push({src:d[2],element:b[0]})}),a.each(l,function(c,d){var e,f=b.attr(d);return f?(e=f.split(","),void a.each(e,function(c,d){d=a.trim(d).split(" ")[0],j.push({src:d,element:b[0]})})):!0})}):i.find("img:has-src").each(function(){j.push({src:this.src,element:this})}),f=j.length,g=0,0===f&&(c.call(i[0]),h.resolveWith(i[0])),a.each(j,function(e,j){var k=new Image,l="load."+b+" error."+b;a(k).one(l,function m(b){var e=[g,f,"load"==b.type];return g++,d.apply(j.element,e),h.notifyWith(j.element,e),a(this).off(l,m),g==f?(c.call(i[0]),h.resolveWith(i[0]),!1):void 0}),k.src=j.src})}),h.promise()}}); -------------------------------------------------------------------------------- /markppt/ppt_/oops.md: -------------------------------------------------------------------------------- 1 | # Oops.. 2 | 3 | Something goes wrong. 4 | -------------------------------------------------------------------------------- /p/2014/03/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/03/book.png -------------------------------------------------------------------------------- /p/2014/03/mom-and-textbooks.md: -------------------------------------------------------------------------------- 1 | # 📚 母亲与课本 2 | 3 | *2014-03-08* 4 | 5 | 打我小时候,母亲就开始小心地替我收藏起我的课本
6 | 小学时代,初中,高中..渐渐地,我的柜子底下被放满了 7 | 8 | 我觉得碍位置,几次建议把它们卖了,母亲没答应
9 | 某天我急了,把书全都搬到客厅门口,母亲并未多说什么
10 | 没多久我回了学校,也把这事给忘了.. 11 | 12 | 在学校,我看到了<不要反对父母做的10件事>,我的心颤了一下
13 | 我猛然想起了临走前门口的那些书,它们是否还安在.. 14 | 15 | 它们就是这些年来我从学校走过的见证啊,
16 | 它们是知识,是岁月,更是我的成长
17 | 而正是我的母亲,这么多年来,当我还在无知地看待这一切的时候,
18 | 在我身后不作声地,一点一滴地替我把握住这些财富..
19 | 感谢你那缄默而沉甸的付出,我的母亲. 20 | 21 | ![ ](book.png) 22 | 23 | 附诗一首: 24 | 25 | > <春夜喜雨>
26 | -- 杜甫
27 | 好雨知时节,当春乃发生.
28 | 随风潜入夜,润物细无声.
29 | 野径云俱黑,江船火独明.
30 | 晓看红湿处,花重锦官城. 31 | -------------------------------------------------------------------------------- /p/2014/04/keeping-determined.md: -------------------------------------------------------------------------------- 1 | # 坚定 2 | 3 | *2014-04-29* 4 | 5 | ## 潜心修炼还是积极应征? 6 | 7 | 前一阵子闹得沸沸扬扬的校园招聘,腾讯,本着一颗重在参与的心, 8 | 跟风投递了简历,听说小剑伯广州杀进了二面, 9 | 在深圳的我们也渐渐变得雄心勃勃、志在必得,结果不也挂在了笔试上, 10 | 止步不前。正如小剑伯所说,这是一次“充电”, 11 | 我们都意识到了自己身上的不足,也希望通过努力来进步。 12 | 13 | 这般跟风应征,难免让我本不平静的心,更加焦躁了起来。 14 | 是回归自我,潜心修炼,还是走出校园,一展身手?哪一种最优,我有些疑惑。 15 | 16 | 但也许两者并不矛盾。心静,到哪里不是静;懂得规划时间,如何不能腾出时间进修。 17 | 18 | ## Github上的“虚荣”? 19 | 20 | Github,这个我们熟知并且谓之神圣的网站,是程序员们自家战利品的博览会, 21 | 猎头们物色人的新战场,也是一个罪恶的“虚荣工厂”? 22 | 23 | 最近我在async这个全npm第二 24 | 多人用的js库连续贡献了数次提交,跻身80多个贡献者中的前10, 25 | 确实令我傲气冲天、目中无人。尤其是刚刚被合并这次, 26 | 更是得到了原作者和议题开启人(提问者)双方的同时 27 | 肯定:[caolan/async#521](https://github.com/caolan/async/issues/521)。 28 | 当我再一次向洪比炫耀时,他认为这是一种虚荣的表现,并企图泼我冷水。 29 | 30 | 不过这回我倒是坚定,因为我不再想做那个 “不坚定的二徒弟” ,人云亦云,妄自菲薄。 31 | 我理性地辩解道,我承认这其中的“虚荣”没错, 32 | 这种功绩对我来说只是一项较为直观的能力证明, 33 | 同时它也绝非全部。我非常满意于自己此次的说辞。 34 | -------------------------------------------------------------------------------- /p/2014/05/DSC07948.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/05/DSC07948.JPG -------------------------------------------------------------------------------- /p/2014/05/DSC07978.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/05/DSC07978.JPG -------------------------------------------------------------------------------- /p/2014/05/_focus-or-radiate.md: -------------------------------------------------------------------------------- 1 | # 专注还是发散? 2 | 3 | *2014-05-30* 4 | 5 | ## 涣散的意志 6 | 7 | 告别高中生涯后,大学生活已接近3年。我的注意力日益下降, 8 | 居然可以做到,一门科目,堂堂课都有“听讲”,最后竟考了不足30分。 9 | 是的,我挂科了,兴趣、自律是一回事,但注意力的把控是关键。 10 | 11 | 我的注意力像脱缰的野马般不听使唤,四处发散。 12 | 13 | ## 确定病症 14 | 15 | 百度了一下,糟糕,[ADD][1](注意力缺失症)、[ADHD][2](注意力缺陷多动障碍)。 16 | 17 | 要知道,看这些资料,对于一个“注意力缺失症”患者是多么困难。 18 | 19 | > 1. 不注意细节,常犯粗心的错误 20 | 1. 在日常活动中健忘 21 | 1. 多动,冲动,处事不假思索 22 | 1. 容易厌烦,不遵守规则 23 | 1. 读写困难 24 | 25 | 还有很多,没错,说的就是我,箭箭穿膝。 26 | 27 | 另外,这已经不是我在自己身上发现的第一个“D”了,更早的是[OCD][3]。 28 | 29 | ## 病因 30 | 31 | 很遗憾,我看到了这句: 32 | 33 | > 目前最一致的资料是小脑中间(小脑蚓部,位于脑后下端)及脑部中间区域(包括部分脑干)的大小缩减。 34 | 35 | 还有这个: 36 | 37 | > 网络游戏上瘾的人群往往依靠网络游戏带来的高度刺激获得注意力集中。 38 | 一旦他们的刺激环境降低,如较枯燥的学习课程和工作,则易犯困,大脑无法在低刺激环境分泌多巴胺, 39 | 而导致无法集中注意力学习。长期暴露在高刺激的网络游戏上,则越来越难以在日常生活简单任务上集中注意力。 40 | >> 小时候游戏玩多了? 41 | 42 | ## 两面性 43 | 44 | 一切事物都是有两面的。 45 | 在这之前,我早就意识到自己思维的发散性了。 46 | 在解决这个问题之前(当然愿不愿意解决是另一回事了), 47 | 我能勉强体会到的优势,和百科上的差不多: 48 | 49 | 1. 不随俗的思考方式,跨度大,想法多 50 | 1. 惊人的坚持度和毅力(兴趣范围之内) 51 | 1. 直觉非常强(难免主观,虽然总认为自己是对的) 52 | 53 | > 有注意力缺乏及紊乱症的人往往是那些智商比较高的人。 54 | 55 | 虽然这句话可靠性不高,但听起来还是很爽。 56 | 57 | 当然,我相信注意力一定是流向了其他某些地方,如蓝天白云、阿猫阿狗、女人的胸部, 58 | 又或者是那一行行的代码,也很可能是四面八方,无处不在。 59 | 60 | 这是注意力分配上的严重失衡。我需要更深入的调查。 61 | 62 | 专注还是发散?看着办吧。 63 | 64 | ## FAQ 65 | 66 | 1. > 你有多动症? 67 | 68 | 小时候爸妈曾带我去医院看过多动症。现在我信了。 69 | 70 | 1. > 你读写困难? 71 | 72 | 没错,看一篇文章和写一篇文章都需要相当长的时间。 73 | 74 | 1. > 为什么你如此确定?你了解ADD吗? 75 | 76 | 也许又是一种逃避,但是,没有人比我更了解我自己。 77 | 78 | [1]: http://baike.baidu.com/view/2071047.htm 79 | [2]: http://baike.baidu.com/view/587357.htm 80 | [3]: http://zh.wikipedia.org/wiki/OCD 81 | -------------------------------------------------------------------------------- /p/2014/05/lift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/05/lift.png -------------------------------------------------------------------------------- /p/2014/05/markdown-talk.md: -------------------------------------------------------------------------------- 1 | # 浅谈Markdown 2 | 3 | *2014-05-28* 4 | 5 | ## 概述 6 | 7 | > Markdown是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档,然后转换成有效的HTML文档。 8 | 9 | 大家都知道HTML,超文本标记语言,各种``标签,构成了网页的内容,再加上样式和脚本,就构成了完整的网页。 10 | 11 | “Markdown”,与“HTML”中的“Markup”相对,大概作者认为它是HTML“卸妆”后的朴素原型吧。 12 | 13 | ## 应用 14 | 15 | > 世界上最流行的博客平台WordPress和大型CMS如joomla、drupal都能很好的支持Markdown。 16 | 17 | 程序员的天堂Github,也大量使用Markdown,用户都在用它来发Issue和写README。 18 | 一段时间的“照猫画虎”,我也成忠实粉丝了。 19 | 20 | 现在能轻松写出[高大上的README][6],对了,我的[整个博客][7]都是Markdown。 21 | 22 | 如果你还不会Markdown,这是不错的[新手教程][2]。 23 | 24 | ## 优势 25 | 26 | ### 化繁为简——简洁 27 | 28 | Markdown省略了HTML中的开闭标签,取而代之以简单形象的符号,使书写和阅读更加轻松、愉悦。 29 | 30 | ### 有舍有得——专注 31 | 32 | Markdown自身语法仅涵盖了最基本的格式,如标题、粗斜体、超链接、图片、列表、引用、代码等。 33 | 一般情况下,尽量不去额外嵌入HTML。 34 | 35 | 因此在写作时,我们可以更专注于“力所能及”的文章内容本身,而非繁杂的标签和过多的排版甚至样式。 36 | 37 | ### 有迹可循——版本跟踪 38 | 39 | - 使用Word,是二进制文件,没有有效的版本比对 40 | - 使用HTML,由于冗余性,版本比对的清晰度不如Markdown 41 | 42 | 版本跟踪用于掌握文件的更改历史,正如我们在Github上见到的。 43 | 44 | ## 要点 45 | 46 | 其实只是我个人的Markdown风格指示,供参考,理由略: 47 | 48 | 1. 文件后缀名使用`.md` 49 | 50 | 1. 使用`
`换行,而不是尾随的空格 51 | 52 | 1. 使用`#`/`##`表示标题,而不是紧跟一行`===`/`---` 53 | 54 | 1. 有序列表前缀全部使用`1.`,而不是`1.`/`2.`/`3.` 55 | 56 | 1. 无序列表前缀使用`-`,而不是`*`/`+` 57 | 58 | 1. 渲染器采用如下选项,[marked渲染器选项说明][4]: 59 | 60 | ```js 61 | { 62 | gfm: true, 63 | tables: true, 64 | breaks: false, 65 | pedantic: false, 66 | sanitize: false, 67 | smartLists: true, 68 | smartypants: false 69 | } 70 | ``` 71 | 72 | ## 参考资料 73 | 74 | - [Markdown - 维基百科][1] 75 | - [Markdown - 百度百科][5] 76 | - [献给写作者的 Markdown 新手指南][2] 77 | - [Markdown写作浅谈][3] 78 | 79 | [1]: http://zh.wikipedia.org/wiki/Markdown 80 | [2]: http://jianshu.io/p/q81RER 81 | [3]: http://jianshu.io/p/PpDNMG 82 | [4]: https://github.com/chjj/marked#options 83 | [5]: http://baike.baidu.com/view/2311114.htm 84 | [6]: ../../projects.md 85 | [7]: https://github.com/fritx/blog 86 | -------------------------------------------------------------------------------- /p/2014/05/mom-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/05/mom-1.jpg -------------------------------------------------------------------------------- /p/2014/05/mom-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/05/mom-3.jpg -------------------------------------------------------------------------------- /p/2014/05/mom-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/05/mom-4.jpg -------------------------------------------------------------------------------- /p/2014/05/mothers-day.md: -------------------------------------------------------------------------------- 1 | # 🙎🏻‍♀️ 母亲节 2 | 3 | *2014-05-11* 4 | 5 | ## 由来 6 | 7 | > 母亲节(Mother's Day),是一个感谢母亲的节日。这个节日最早出现在古希腊;而现代的母亲节起源于美国,是每年5月的第二个星期日。母亲们在这一天通常会收到礼物,康乃馨被视为献给母亲的花,而中国的母亲花是萱草花,又叫忘忧草。 8 | 9 | ## 故事 10 | 11 | 一个信佛的小伙离家出走,一路跋山涉水,登上山顶向高僧讨教佛道。高僧告诉他,下山途中,但凡有人家赤脚为你开门,拜她为佛,悉心待奉,定能成佛。 12 | 13 | 一天,两天,三天……投宿的人家中,并没有出现高僧口中的“佛”,小伙从灰心到绝望,最终,他疲惫地叩响了家门。他发现,赤脚为他开门的正是他的母亲。 14 | 15 | 噢,原来佛是母亲。一个人连生他养他的母亲都不待奉,还求什么神拜什么佛。 16 | 17 | ## 老苏 18 | 19 | 是的,老苏又拿到了学校的奖学金,昨天妈妈告诉我的时候,我已经在facebook上祝贺过他了。 20 | 21 | 很羡慕老苏,他和他“妈咪”如此亲近。而长期以来,太多的事对于其他人来说是多么的难。 22 | 23 | 老苏真的是个好榜样! 24 | 25 | ## 妈妈,母亲节快乐! 26 | 27 | 21年了(还没算上肚子里的时候) 28 | 29 | 您辛苦了!永远爱你。 ^.^ 30 | 31 | 32 | 33 | 34 | 35 |    36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /p/2014/05/my-resume.md: -------------------------------------------------------------------------------- 1 | # 我的简历 2 | 3 | *2014-05-13* 4 | 5 | ## 基本信息 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
姓名林亮 12 | 13 |
手机134\*\*\*\*1979
电子邮箱uxfritz@163.com
QQ364028813
个人博客[fritx.github.io/blog](http://fritx.github.io/blog)
性别出生年月1993-05
学历本科院校五邑大学
专业软件工程毕业时间2015-07
38 | 39 | ## 期望工作 40 | 41 | | 地点 | 职型 | 职位 | 空闲区间 | 42 | | :-: | :-: | :-: | :-: | 43 | | 深圳 | 实习 | WEB前端/后端 | 暑期、大四全年 | 44 | 45 | ## 项目经验 46 | 47 | 1. 2013年04月参与江门市社保局内部系统(网页)前端开发 48 | 1. 2013年06月参与五邑大学邑大唱吧(微信)前后端开发 49 | 1. 2013年09月参与演讲家App前后端开发 50 | 1. 2013年12月参与校友群(手机应用)后端开发 51 | 1. 2014年03月参与五邑大学闺蜜网(移动电商)前端开发 52 | 53 | ## 作品展示 54 | 55 | 1. 江门社保局内部系统前端源码 [phrief/jmsis](https://github.com/phrief/jmsis-public) 56 | 1. 校友群后端源码/截图 [node-fun/siyuan](https://github.com/node-fun/siyuan) 57 | 1. 邑大唱吧源码/截图 [fritx/wyu-sing](https://github.com/fritx/wyu-sing) 58 | 1. 闺蜜网前端源码/截图 [fritx/mshop](https://github.com/fritx/mshop) 59 | 1. 通用静态博客框架silent源码/截图 [fritx/silent](https://github.com/fritx/silent) 60 | 1. 邑大学生子系统PC客户端源码 [h5lium/xstu](https://github.com/h5lium/xstu) 61 | 1. 宿舍合作演讲家App源码 [3dobe/yjjapp](https://github.com/3dobe/yjjapp) 62 | 1. 宿舍合作博客框架freeblog源码 [3dobe/freeblog](https://github.com/3dobe/freeblog) 63 | 64 | (备注: 该代码托管网站github.com国内访问较不稳定) 65 | -------------------------------------------------------------------------------- /p/2014/05/out-of-campus.md: -------------------------------------------------------------------------------- 1 | ## silent走出校门 2 | 3 | *2014-05-30* 4 | 5 | 自[silent][1]发布后,得到了一些同学的支持,他们成了用户,我很感激他们。 6 | 7 | 我在收藏者列表中,发现了一个老外,还有正在尝试silent的另一个家伙。 8 | 9 | 这表明,silent的用户中不但有我的同学,还有其他的人,它算是“走出校门”了。 10 | 无论对于它,还是对于我,都是一个里程碑。 11 | 12 | 那个“家伙”一连写了几篇博文,我特别关注的是: 13 | 14 | 1. silent和其他静态博客框架的比较 15 | 1. 选择silent的原因 16 | 1. 对silent的解析与改进 17 | 18 | 另外他还主动添加了“由silent驱动”的类似说明。 19 | 了解到这些之后,我对他的道德观念、辩证思维、动手能力肃然起敬。 20 | 同时有几分“他乡遇知己”的感觉。 21 | 22 | > 久旱逢甘雨,他乡遇故知。
23 | 洞房花烛夜,金榜挂名时。 24 | 25 | 考虑到隐私,我对“误闯”也感到抱歉,因此我没有直接给出链接。 26 | 27 | [1]: ../../projects/silent/ 28 | -------------------------------------------------------------------------------- /p/2014/05/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/05/photo.jpg -------------------------------------------------------------------------------- /p/2014/05/step-by-step.md: -------------------------------------------------------------------------------- 1 | # 脚踏实地 2 | 3 | *2014-05-21* 4 | 5 | ## 邑大开发者沙龙 6 | 7 | 若是没有英爷的积极推动,这两次开发者沙龙不可能顺利进行。 8 | 感谢英爷的付出,还有上台分享经验的,赞助我们的,到场交流的所有人,感谢你们。 9 | 10 | 我又一次接受了英爷的邀请,分享的依然是Nodejs方向,这次是构建工具Gulp。 11 | 以前端项目为例,介绍如何使用Gulp来自动化运行编译、监视、刷新等任务,加速开发。 12 | 13 | 看到剑伯他们开始关注Gulp,我感到很高兴。演讲也使我得到了锻炼,感谢英爷给我这个机会。 14 | 15 | 关于[本次开发者沙龙][2](WYU Dev Conf 2014 S1),雄爷也写了一篇[精彩的博文][1]。 16 | 17 | > 天啊!亮爷又坑了!两次演示都失败!我都替他晕菜了! 18 | 但是他还是讲的不错的.起码知道了coffcescript还有一些gulp跟xxx的对比! 19 | 20 | 拜托,前面的演示妥妥的,最后那段是观众批准后临时附加的,没有什么关系。 21 | 22 | 漂亮的合影: 23 | 24 | ![ ](DSC07948.JPG) 25 | 26 | ![ ](DSC07978.JPG) 27 | 28 | 更多照片:[百度云][3] 29 | 30 | ## 鼓励和挫折 31 | 32 | 近来真是悲喜交加。 33 | 34 | 喜,拖了很久的博客终于上线了,还做发布了[命令行工具silent][4],供他人使用。 35 | 36 | 这是一套静态博客框架,我热爱它,因为它的纯净。 37 | [昌哥][5]、[雄爷][6]、[伟涛][7]都开博客了,他们给予我支持,尤其是雄爷。 38 | 希望他们都能参与进来,一起发展这套博客框架。 39 | 40 | 在Gulp项目上,我无意间提出了一个[热门的议题][8]。大牛们的交流,给了成就感。 41 | 42 | 悲,将silent发布到cnode社区上,企图炫耀,但却无人问津,只换来了收藏+1。 43 | 没想到那些家伙对前端缺乏兴趣,或是看不惯这种[舍我其谁的语气][9],我高估了他们的性情。 44 | 45 | 我的[Github账号][10]越来越光彩。我开始肆无忌惮地进攻那些热门项目, 46 | 毫不客气,却发现我的意见不再受人欢迎。 47 | 48 | 我开始审视自己。 49 | 50 | 1. 是我太嚣张了吗?是的,自从[鼓吹项目][11]、[鼓吹自己][12]后,我的言语变得轻狂。 51 | 1. 是我的发言太水了吗?是的,他们只希望在Github上看到关键的信息。 52 | 1. 是我太草率了吗?是的,贪图名利使我急于提出异议,而缺乏调查。 53 | 54 | 我应该落地了,消停一下,把东西再过一遍,做足了准备,再出手。记住教训,回归成长。 55 | 56 | > 没有调查,就没有发言权。 57 | 58 | 脚踏实地,就先从脚踏稳了地面,一步一步走路开始吧。 59 | 60 | [1]: http://jacsonlee.github.io/Blog/?Diary/wyu-dev-conf 61 | [2]: https://github.com/WuyiUniversity/forum/issues/8 62 | [3]: http://pan.baidu.com/s/1hqeK4ra#dir/path=%2FDEV_Conf_2014 63 | [4]: ../../projects/silent/ 64 | [5]: http://huangruichang.github.io 65 | [6]: http://jacsonlee.github.io 66 | [7]: http://iamjayden.github.io 67 | [8]: https://github.com/gulpjs/gulp/issues/468 68 | [9]: http://cnodejs.org/topic/537b6e29c3ee0b582000adc4 69 | [10]: https://github.com/fritx 70 | [11]: ../../projects.md 71 | [12]: my-resume.md 72 | -------------------------------------------------------------------------------- /p/2014/05/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/05/sun.png -------------------------------------------------------------------------------- /p/2014/05/taught-by-hong.md: -------------------------------------------------------------------------------- 1 | ## 洪比的教诲 2 | 3 | *2014-05-30* 4 | 5 | 作为死党之一,洪比已经不止一次提醒我:不要过分看重(编程)语言。 6 | 7 | > 1. 语言只是工具 8 | 1. 不要把自己的能力、素质跟语言绑定,这是推卸责任 9 | 1. 重要的不是“用什么”,而是“怎么用” 10 | 11 | 我一向以“学习Node.js/HTML5”等“新技术”自居,需求优越感, 12 | 或许自负,或许如他所说,“推卸责任”或逃避着什么。 13 | 14 | 他看不惯,于是三番五次给我忠告。他的其他忠告包括: 15 | 16 | > 1. 你需要学习一门静态语言了 17 | 1. 说是没用的,我要看到你去做 18 | 1. 二爷又熬夜了 19 | 20 | 在我眼里洪比就是先知,表面的邋遢和不恭遮蔽不了内在的眼界与肚量, 21 | 分析问题入木三分,讲起道理语重心长。 22 | -------------------------------------------------------------------------------- /p/2014/06/20140605_115154.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/20140605_115154.jpg -------------------------------------------------------------------------------- /p/2014/06/20140605_123257.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/20140605_123257.jpg -------------------------------------------------------------------------------- /p/2014/06/_clean-qq-groups.md: -------------------------------------------------------------------------------- 1 | ## 清理Q群 2 | 3 | *2014-06-04* 4 | 5 | 我坚信生活就像代码,越简单维护起来就越轻松。今天,我决定清理一下Q群。 6 | 7 | 很多群一直有屏蔽,但我认为堆在那不干净,而且影响启动速度,一狠心砍了不少,**56=>27**,世界“清净”了。清理的过程中,勾起了我对过往的一些追念。 8 | 9 | 1. 游戏群、社交群。虽然没有过多交流,但也在岁月中留下一道珍贵的痕迹,该退了。 10 | 1. 集体群、活动群。各种功能,各种理由。一路走来,留下好多。每个群都牵扯好多情感,退不去了。 11 | 1. 项目群、技术群。大学以后,跟学习工作最密切,除去冗余的,都留了。 12 | 13 | 我强迫自己把个别群的屏蔽解除,为了更好地融入集体,更好地学习技术。**不要去烦,要敞开胸怀**。迎接一个新的生活,这只是一方面。这得向英董学习,这么多群,每个群都照顾得无微不至,真难想象。 14 | -------------------------------------------------------------------------------- /p/2014/06/_keep-up-with-friends.md: -------------------------------------------------------------------------------- 1 | ## 落后的呆瓜 2 | 3 | *2014-06-05* 4 | 5 | 终于有机会跟方、李重聚了,地点仙湖。他们是我在深仅剩的俩死党了,真的。 6 | 7 | 是的,这是个坏消息,我**坦然接受**了。 8 | 9 | 几年前,我把这两个风格相当的死党介绍到一块,三人便经常一起行动。悲哀的是,由于个人[思想问题](../05/focus-or-radiate.md),我和他们在共同话题上差距愈来愈大。而他们的默契,难以置信地忽略了这些。 10 | 11 | 过去,我陪他们逛华强北、电子城,对电子科技的熟知度望尘莫及。今天,他们更谈政治、旅游、影视、哲学、性爱,我是个局外人。当然,这里面有个过程,但我是**从没改变**的那个。 12 | 13 | 我落后了,我一直都很落后。方却一本正经地说:“没必要,你还是多把心思放在IT方面。”这颇像大人对小孩说:“大人的事小孩别管,好好念书吧。”确实,无意中恰恰给了我这个“没长大的小孩”一分安全感,但我知道,我不能要。 14 | 15 | 我需要反思,我需要努力。我爸的知识面很广,可我却一点没像他。人,不一定一代比一代强啊。 16 | 17 | 你知道吗,这次出行,唯一令我感到和他们**节奏相同**是在什么时候?答,是我们在弘法寺点香的那一刻。遵守礼仪,我们接过了香柱,拿了香柱总得上香吧。面对炽热的火烛和呛鼻的香气,我们秉着呼吸,点起香来。那短短的半分钟,无论是否虔诚,三人平心静气,对我而言,像是回到了那个遥远的起点,我们三个还是平等的,平等的…… 18 | 19 | 20 |    21 | -------------------------------------------------------------------------------- /p/2014/06/_my-father.md: -------------------------------------------------------------------------------- 1 | # 父亲节谈我的父亲 2 | 3 | *2014-06-17* 4 | 5 | ## 父亲节作品 BEC公司简介页 6 | 7 | 屌丝程序员的骄傲,每逢母亲节、父亲节,我都会做个网页什么的,当做是给爸妈的节日礼物。从没掏过钱为他们买过什么。 8 | 9 | 那是两年前了,当时刚学HTML5,创作欲十足,母亲节和父亲节,随手就能设计一个单页主题网页,向爸妈炫耀一下。去年母亲节,正值迷恋3D引擎-THREE.js,把做了个“游戏”,匆匆换上皮肤,说是母亲节的礼物(第一人称射击-简单修复后的[演示地址](./mom));同年父亲节,做了什么,忘了。 10 | 11 | 总之是越来越糟糕,今年母亲节,和三八节一样,一篇短文打发;父亲节,也就是前两天,我cao起旧刀,对着问老爸要的资料,忙了大半天,出炉了一个练手作品-[BEC公司简介页](https://bec.today/)。创作欲流失,总体来说是套模板,主要模板:[Carousel Template for Bootstrap](http://v3.bootcss.com/examples/carousel/),部分图标:[Worktile](https://worktile.com/)。 12 | 13 | 爸爸满意,当然,我自己也满意,这更加重要。这是难得的。值得一提的是,我开设了一个[网站集](http://github.com/fritx/sites/),就以此作开头,以后多套模板增加熟练度,多向现实看齐。 14 | 15 | 16 | ## 对父亲的一些认识 17 | 18 | 父亲出自农村,家里排行老三,是典型的靠读书走出来的。据说平时成绩不算最顶尖,但高考成了文科状元,成了全村的骄傲。本来可以上到更牛逼的院校,但是编制出了点问题,到了深大。当时深大刚建成,条件不错,一切都是新的,用上了国内第一批计算机。 19 | 20 | 在大学里,除了坚持健身房锻炼(我估计那个不比我们邑大的差),练出了“受用至今”的肌肉外,还延续了中学时期广泛的课外阅读。由自己提议,当了个派发信报的跑腿,每天都接触大量文字。 21 | 22 | 如今,他每天必看新浪新闻,从未间断。令我崇拜的是,政治、社会、财经、体育、娱乐,他无一不看,平时有问必答。感觉只有编程技术我胜过他一点点,而他随口抛出的某某公司市值多少,主要高管有谁,近期有哪些并购和整合,总是那么的高大上。 23 | 24 | 他曾经辉煌过,最早一批开奥迪,最早一批大哥大,他吹嘘的时候,我感受到,那眉宇间流露出的无限春光。这方面,我身上有他的影子。其实我家境一般,据说后来股票亏了。 25 | 26 | 我很开心他和我妈都尊重我的兴趣,给我足够大的自由度,去做自己想做的事。虽然他常说:“想不想,能不能,该不该”。 27 | 28 | 说道教育小孩,他多次感慨道,应该好好培养自信,多夸少打。记得我小时候调皮,他打过我,我会委屈地掉眼泪。其实我觉得他没培育好我的自信,小时候我长期弯腰驼背,走路都捡钱,与人说话眼神游离。然后我的自我意识,更多的是为身边的人着想,成了个敏感的人,其实有利有弊。如今,我在尝试纠正自己,自私再自私。 29 | -------------------------------------------------------------------------------- /p/2014/06/mom/crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/crosshair.png -------------------------------------------------------------------------------- /p/2014/06/mom/game/AIDriver.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | // AIDriver extends Driver 5 | var AIDriver = Driver.extend( { 6 | init: function( ship ){ 7 | this._super( ship ); 8 | 9 | // target, strategy 10 | this.target = new THREE.Vector3(); 11 | this.strategy = AIDriver.strategies[ 0 ]; 12 | 13 | // switching strategy 14 | var _this = this; 15 | this.think.timer = setInterval( function(){ 16 | _this.think(); 17 | }, 1000 ); 18 | this.think(); 19 | }, 20 | 21 | think: function(){ 22 | // moving 23 | var r = Math.floor( Math.random() * AIDriver.strategies.length ); 24 | this.strategy = AIDriver.strategies[ r ]; 25 | 26 | // looking 27 | var r1 = Math.random(), 28 | r2 = Math.random(), 29 | r3 = Math.random(); 30 | this.target.set( 31 | 1000 * ( r1 < 0.33 ? 1 : ( r1 < 0.66 ? -1 : 0 ) ), 32 | 1000 * ( r2 < 0.33 ? 1 : ( r2 < 0.66 ? -1 : 0 ) ), 33 | 1000 * ( r3 < 0.33 ? 1 : ( r3 < 0.66 ? -1 : 0 ) ) 34 | ); 35 | 36 | // firing 37 | this.toFire = Math.random() < 0.33; 38 | }, 39 | 40 | update: function(){ 41 | var strategy = this.strategy, 42 | target = this.target; 43 | 44 | // toMove 45 | this.toMove.forth = this.toMove.back = false; 46 | if ( strategy === 'forth' ) { 47 | this.toMove.forth = true; 48 | } else if ( strategy === 'back' ) { 49 | this.toMove.back = true; 50 | } 51 | 52 | // toLook 53 | this.toLook = target.clone().sub( this.ship.position ); 54 | }, 55 | 56 | getCommand: function(){ 57 | this.update(); 58 | 59 | return this._super(); 60 | } 61 | }, { 62 | strategies: [ 'wait', 'forth', 'back' ] 63 | } ); 64 | 65 | window.AIDriver = AIDriver; 66 | })(); -------------------------------------------------------------------------------- /p/2014/06/mom/game/Driver.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | // Driver 5 | var Driver = Class.extend( { 6 | init: function( ship ){ 7 | this.ship = ship; 8 | 9 | // ejectors 10 | this.toMove = { 11 | forth: false, back: false, 12 | left: false, right: false, 13 | up: false, down: false, 14 | } 15 | // weapon 16 | this.toFire = false; 17 | // pointing 18 | this.toLook = ship.pointing.clone(); 19 | }, 20 | 21 | terminate: function(){ 22 | // tell driver the ship is dying 23 | }, 24 | 25 | shock: function(){ 26 | // tell driver the ship is being injured 27 | }, 28 | 29 | getCommand: function(){ 30 | var command = { 31 | toMove: this.toMove, 32 | toFire: this.toFire, 33 | toLook: this.toLook 34 | } 35 | this.toFire = false; 36 | return command; 37 | } 38 | }, { 39 | 40 | } ); 41 | 42 | window.Driver = Driver; 43 | })(); -------------------------------------------------------------------------------- /p/2014/06/mom/game/Missile.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | // Missile extends Unit 5 | var Missile = Unit.extend( { 6 | init: function( host ){ 7 | this._super(); 8 | 9 | // host 10 | this.host = host; 11 | 12 | // harm, speed 13 | this.harm = Missile.harm; 14 | this.speed = Missile.speed; 15 | 16 | // deadline 17 | this.deadline = Date.now() + Missile.lifecycle; 18 | }, 19 | 20 | update: function( delta ){ // override 21 | var quarterActualSpeed = this.speed * delta / 4; 22 | 23 | // hit testing, position updating 24 | for ( var i = 0; i < 4; i ++ ) { 25 | if ( this.hitTest() ) { 26 | this.toDie = true; 27 | break; 28 | } 29 | this.translateZ( - quarterActualSpeed ); 30 | } 31 | 32 | // check deadline 33 | if ( Date.now() > this.deadline ) { 34 | this.toDie = true; 35 | } 36 | }, 37 | 38 | hitTest: function(){ 39 | var didHit = false; 40 | for ( var i = 0, units = this.host.world.units, unit; i < units.length; i ++ ) { 41 | unit = units[ i ]; 42 | if ( this.hits( unit ) ) { 43 | unit.injure( this.harm ); // hurt the unit 44 | didHit = true; 45 | } 46 | } 47 | 48 | return didHit; 49 | }, 50 | 51 | hits: function( unit ){ 52 | var boxA = unit.geometry.boundingBox.clone(), 53 | boxB = this.geometry.boundingBox.clone(); 54 | return boxA.translate( unit.position ) 55 | .isIntersectionBox( boxB.translate( this.position ) ) 56 | && unit !== this && unit !== this.host; 57 | }, 58 | 59 | die: function(){ // override 60 | this.toDie = false; 61 | if ( ! this.alive ) return; 62 | 63 | this.alive = false; 64 | this.stop(); 65 | this.parent.remove( this ); // disappear at once 66 | }, 67 | 68 | injure: function(){ // override 69 | this.toDie = true; // to die when injured 70 | } 71 | }, { 72 | _name: 'missile', 73 | geometry: new THREE.CubeGeometry( 20, 20, 20 ), 74 | 75 | //material: new THREE.MeshBasicMaterial( { color: 0x00ff00 } ), 76 | material: new THREE.MeshBasicMaterial( 77 | { 78 | map: THREE.ImageUtils.loadTexture( 'textures/ice.png' ) 79 | } 80 | ), 81 | 82 | hpMax: Unit.hpMax * 0.1, 83 | speed: Unit.speed * 5, 84 | harm: 5, 85 | lifecycle: 1000 * 5 // 10s 86 | } ); 87 | 88 | window.Missile = Missile; 89 | })(); -------------------------------------------------------------------------------- /p/2014/06/mom/game/Ship.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | // Ship extends Unit 5 | var Ship = Unit.extend( { 6 | init: function( world ){ 7 | this._super(); 8 | 9 | // speed 10 | this.speed = Ship.speed; 11 | 12 | // world 13 | this.world = world; 14 | 15 | // driver 16 | this.driver = null; 17 | }, 18 | 19 | setDriver: function( driverType ){ 20 | this.driver = new driverType( this ); 21 | }, 22 | 23 | update: function( delta ){ // override 24 | // moving command 25 | var offset = new THREE.Vector3(), 26 | command = this.driver.getCommand(), 27 | toMove = command.toMove; 28 | toMove.forth && ( offset.z -= 1 ); 29 | toMove.back && ( offset.z += 1 ); 30 | toMove.left && ( offset.x -= 1 ); 31 | toMove.right && ( offset.x += 1 ); 32 | toMove.up && ( offset.y += 1 ); 33 | toMove.down && ( offset.y -= 1 ); 34 | offset.normalize(); 35 | 36 | // move 37 | var actualOffset = offset 38 | .multiplyScalar( delta * this.speed ); 39 | this.translate( actualOffset ); 40 | // fire 41 | if ( command.toFire ) { 42 | this.fire(); 43 | } 44 | // look 45 | this.watchBy( command.toLook ); 46 | }, 47 | 48 | fire: function(){ 49 | var scene = this.parent; 50 | 51 | var missile = new Missile( this ); 52 | missile.position.copy( this.position ); 53 | missile.watchBy( this.pointing ); 54 | missile.translateY( -25 ); 55 | scene.add( missile ); 56 | 57 | this.world.units.push( missile ); 58 | missile.start(); 59 | }, 60 | 61 | die: function(){ // override 62 | this._super(); 63 | this.driver.terminate(); 64 | }, 65 | 66 | injure: function( damage ){ // override 67 | this._super( damage ); 68 | this.driver.shock(); 69 | } 70 | }, { 71 | _name: 'ship', 72 | geometry: new THREE.CubeGeometry( 50, 50, 50 ), 73 | 74 | //material: new THREE.MeshBasicMaterial( { color: 0x0000ff } ), 75 | material: new THREE.MeshBasicMaterial( 76 | { 77 | map: THREE.ImageUtils.loadTexture( 'textures/bluewool.png' ) 78 | } 79 | ), 80 | 81 | hpMax: Unit.hpMax, 82 | speed: Unit.speed 83 | } ); 84 | 85 | window.Ship = Ship; 86 | })(); -------------------------------------------------------------------------------- /p/2014/06/mom/game/Sound.js: -------------------------------------------------------------------------------- 1 | ( function(){ 2 | 'use strict'; 3 | 4 | var Sound = Class.extend( { 5 | init: function( radius, sources, loop ){ 6 | // dom 7 | var audio = document.createElement( 'audio' ); 8 | for ( var i = 0, source; i < sources.length; i ++ ) { 9 | source = document.createElement( 'source' ); 10 | source.src = sources[ i ]; 11 | audio.appendChild( source ); 12 | } 13 | audio.volume = 1; 14 | audio.loop = true; 15 | 16 | this.audio = audio; 17 | 18 | // radius, position 19 | this.radius = radius; 20 | this.position = new THREE.Vector3(); 21 | }, 22 | 23 | update: function( position ){ 24 | var distance = this.position.distanceTo( position ); 25 | 26 | if ( distance > this.radius ) { // too far 27 | this.audio.volume = 0; 28 | } else { 29 | this.audio.volume = 1 - Math.pow( distance / this.radius, 2 ); 30 | } 31 | }, 32 | 33 | play: function(){ 34 | this.audio.play(); 35 | }, 36 | 37 | pause: function(){ 38 | this.audio.pause(); 39 | } 40 | }, { 41 | 42 | } ); 43 | 44 | window.Sound = Sound; 45 | } )(); -------------------------------------------------------------------------------- /p/2014/06/mom/game/Station.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | // Station extends Unit 5 | var Station = Unit.extend( { 6 | init: function(){ 7 | this._super(); 8 | }, 9 | 10 | injure: function( damage ){ // override 11 | damage = 0; // station receives no damage 12 | this._super( damage ); 13 | } 14 | }, { 15 | _name: 'station', 16 | geometry: new THREE.CubeGeometry( 500, 500, 500 ), 17 | 18 | //material: new THREE.MeshBasicMaterial( { color: 0xff00ff } ), 19 | material: new THREE.MeshBasicMaterial( 20 | { 21 | map: THREE.ImageUtils.loadTexture( 'textures/blockDiamond.png' ) 22 | } 23 | ), 24 | 25 | hpMax: Unit.hpMax * 10 26 | } ); 27 | 28 | window.Station = Station; 29 | })(); -------------------------------------------------------------------------------- /p/2014/06/mom/game/UserDriver.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | // UserDriver extends Driver 5 | var UserDriver = Driver.extend( { 6 | init: function( ship ){ 7 | this._super( ship ); 8 | 9 | // looking parameters 10 | this.lon = 0; 11 | this.lat = 0; 12 | this.phi = 0; 13 | this.theta = 0; 14 | 15 | // listen events 16 | $( document ).on( 17 | 'keydown keyup', 18 | bind( UserDriver.onKeyChange, this ) 19 | ).on( 20 | 'mousemove', 21 | bind( UserDriver.onMouseMove, this ) 22 | ).on( 23 | 'mousedown', 24 | bind( UserDriver.onMouseDown, this ) 25 | ); 26 | 27 | function bind( fn, scope ) { 28 | return function(){ 29 | fn.apply(scope, arguments); 30 | } 31 | } 32 | }, 33 | 34 | terminate: function(){ // override 35 | this.ship.world.setCamera( 36 | [ 2000, 2000, 2000 ], 37 | [ -1, -1, -1 ] 38 | ); 39 | }, 40 | 41 | shock: function(){ // override 42 | this._super(); 43 | 44 | // notify the user 45 | console.log( 'damaged' ); 46 | } 47 | }, { 48 | onMouseMove: function( event ){ 49 | if ( ! this.ship.world.locked ) return; 50 | event = event.originalEvent; 51 | var dx = event.webkitMovementX || event.mozMovementX || 0, 52 | dy = event.webkitMovementY || event.mozMovementY || 0; 53 | 54 | this.lon += dx * UserDriver.lookingSpeed; 55 | this.lat += dy * UserDriver.lookingSpeed * World.windowRatio; 56 | 57 | this.lat = Math.max( - 240, Math.min( 240, this.lat ) ); 58 | this.phi = THREE.Math.degToRad( 90 - this.lat ); 59 | this.phi = THREE.Math.mapLinear( this.phi, 0, 60 | Math.PI, UserDriver.verticalMin, UserDriver.verticalMax ); 61 | this.theta = THREE.Math.degToRad( this.lon ); 62 | 63 | this.toLook.set( 64 | Math.sin( this.phi ) * Math.cos( this.theta ), 65 | - Math.cos( this.phi ), 66 | Math.sin( this.phi ) * Math.sin( this.theta ) 67 | ); 68 | }, 69 | 70 | onMouseDown: function( event ){ 71 | if ( ! this.ship.world.locked ) return; 72 | 73 | if ( event.which === 1 ) { 74 | this.toFire = true; 75 | } 76 | }, 77 | 78 | onKeyChange: function( event ){ 79 | if ( ! this.ship.world.locked ) return; 80 | var flag = event.type === 'keydown', 81 | key = event.which, 82 | keyTable = UserDriver.keyTable; 83 | 84 | if ( key === keyTable.W ) { 85 | this.toMove.forth = flag; 86 | } else if ( key === keyTable.S ) { 87 | this.toMove.back = flag; 88 | } else if ( key === keyTable.A ) { 89 | this.toMove.left = flag; 90 | } else if ( key === keyTable.D ) { 91 | this.toMove.right = flag; 92 | } else if ( key === keyTable.R ) { 93 | this.toMove.up = flag; 94 | } else if ( key === keyTable.F ) { 95 | this.toMove.down = flag; 96 | } 97 | }, 98 | 99 | lookingSpeed: 0.1, 100 | verticalMin: 1.1, 101 | verticalMax: 2.2, 102 | 103 | keyTable: { 104 | W: 87, S: 83, A: 65, D: 68, R: 82, F: 70 105 | } 106 | } ); 107 | 108 | window.UserDriver = UserDriver; 109 | })(); -------------------------------------------------------------------------------- /p/2014/06/mom/game/main.js: -------------------------------------------------------------------------------- 1 | // world, user 2 | var world = new World(); 3 | var station = world.addStation( [ 0, 0, 0 ] ); 4 | var user = world.addUserShip( [ 0, 0, 400 ], [ 0, 0, -1 ] ); 5 | world.bindCamera( user ); 6 | 7 | // npc 8 | world.addAIShip( [ 0, 0, -400 ], [ 0, 0, 1 ] ); 9 | world.addAIShip( [ 400, 0, 0 ], [ -1, 0, 0 ] ); 10 | world.addAIShip( [ -400, 0, 0 ], [ 1, 0, 0 ] ); 11 | world.addAIShip( [ 0, 400, 0 ], [ 0, -1, 0 ] ); 12 | world.addAIShip( [ 0, -400, 0 ], [ 0, 1, 0 ] ); 13 | 14 | // for mother's day 15 | // photosed material 16 | var materials = []; 17 | for ( var i = 0; i < 6; i ++ ) { 18 | materials.push( 19 | new THREE.MeshBasicMaterial( { 20 | map: THREE.ImageUtils.loadTexture( 21 | [ 22 | 'photos/', '.jpg' 23 | ].join( ( i < 10 ? '0': '' ) + i ) 24 | ) 25 | } ) 26 | ); 27 | } 28 | station.setMaterial( 29 | new THREE.MeshFaceMaterial( materials ) 30 | ); 31 | // sound 32 | world.addSound( [ 0, 0, 0 ], 4000, [ 33 | 'sounds/莫扎特 - 小星星变奏曲.mp3', 34 | 'sounds/莫扎特 - 小星星变奏曲.ogg' 35 | ] ); -------------------------------------------------------------------------------- /p/2014/06/mom/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 空间大战 母亲节版 -- by 林亮 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |





Generating world...
13 |
14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /p/2014/06/mom/lib/class.js: -------------------------------------------------------------------------------- 1 | /** Simple JavaScript Inheritance 2 | * By John Resig http://ejohn.org/ 3 | * MIT Licensed. 4 | */ 5 | // Inspired by base2 and Prototype 6 | /* 7 | * modified by h5-Lium / http://weibo.com/hellolium 8 | * support statics: MyClass._.xxx, MyClass.xxx 9 | * provide Class reference: myInstance._class 10 | */ 11 | (function(){ 12 | var _initializing = false; 13 | this.Class = function(){}; 14 | Class._ = {}; 15 | Class.extend = function(prop, statics) { 16 | function Class() { 17 | if (! _initializing && this.init) 18 | this.init.apply(this, arguments); 19 | } 20 | Class.constructor = Class; 21 | Class.extend = arguments.callee; 22 | var _super = this.prototype; 23 | _initializing = true; 24 | var prototype = new this(); 25 | _initializing = false; 26 | 27 | for (var k in prop) { 28 | prototype[k] = typeof prop[k] === 'function' 29 | && typeof _super[k] === 'function'? 30 | (function(k, fn){ 31 | return function(){ 32 | var tmp = this._super; 33 | this._super = _super[k] || function(){}; 34 | var ret = fn.apply(this, arguments); 35 | this._super = tmp; 36 | return ret; 37 | }; 38 | })(k, prop[k]): prop[k]; 39 | } 40 | 41 | Class._ = {}; 42 | for (var k in this._) { 43 | Class._[k] = this._[k]; 44 | Class[k] = Class._[k]; 45 | } 46 | for (var k in statics) { 47 | Class._[k] = statics[k]; 48 | Class[k] = Class._[k]; 49 | } 50 | prototype._class = Class; 51 | 52 | Class.prototype = prototype; 53 | return Class; 54 | }; 55 | })(); -------------------------------------------------------------------------------- /p/2014/06/mom/lib/locker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Pointer Lock API 3 | * https://developer.mozilla.org/en-US/docs/WebAPI/Pointer_Lock 4 | */ 5 | // modified by h5-Lium / http://weibo.com/hellolium 6 | 7 | (function( w, d, _ ){ 8 | w.Locker = {}; 9 | 10 | Locker.lockPointer = function( elem ){ 11 | elem.requestFullscreen = elem.requestFullscreen 12 | || elem.webkitRequestFullscreen 13 | || elem.mozRequestFullscreen 14 | || elem.mozRequestFullScreen; // Older API upper case 'S'. 15 | elem.requestFullscreen(); 16 | } 17 | 18 | Locker.setHandler = function( handler ){ 19 | _handler = handler; 20 | } 21 | 22 | d.addEventListener( 'pointerlockchange', onChange, false ); 23 | d.addEventListener( 'webkitpointerlockchange', onChange, false ); 24 | d.addEventListener( 'mozpointerlockchange', onChange, false ); 25 | 26 | d.addEventListener('fullscreenchange', fullscreenChange, false); 27 | d.addEventListener('webkitfullscreenchange', fullscreenChange, false); 28 | d.addEventListener('mozfullscreenchange', fullscreenChange, false); 29 | 30 | function _handler( locked ) {} 31 | function onChange( ev ) { 32 | var locked = d.webkitPointerLockElement 33 | || d.mozPointerLockElement; 34 | _handler( locked ); 35 | } 36 | 37 | function fullscreenChange() { 38 | var elem = d.webkitFullscreenElement 39 | || d.mozFullscreenElement 40 | || d.mozFullScreenElement; 41 | if ( elem ) { 42 | elem.requestPointerLock = elem.requestPointerLock 43 | || elem.webkitRequestPointerLock 44 | || elem.mozRequestPointerLock; 45 | elem.requestPointerLock(); 46 | } 47 | } 48 | })( window, document ); -------------------------------------------------------------------------------- /p/2014/06/mom/lib/stats.min.js: -------------------------------------------------------------------------------- 1 | // stats.js - http://github.com/mrdoob/stats.js 2 | var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; 3 | i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); 4 | k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= 5 | "block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:11,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= 6 | a+"px",m=b,r=0);return b},update:function(){l=this.end()}}}; 7 | -------------------------------------------------------------------------------- /p/2014/06/mom/photos/00.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/photos/00.jpg -------------------------------------------------------------------------------- /p/2014/06/mom/photos/01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/photos/01.jpg -------------------------------------------------------------------------------- /p/2014/06/mom/photos/02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/photos/02.jpg -------------------------------------------------------------------------------- /p/2014/06/mom/photos/03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/photos/03.jpg -------------------------------------------------------------------------------- /p/2014/06/mom/photos/04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/photos/04.jpg -------------------------------------------------------------------------------- /p/2014/06/mom/photos/05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/photos/05.jpg -------------------------------------------------------------------------------- /p/2014/06/mom/sounds/莫扎特 - 小星星变奏曲.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/sounds/莫扎特 - 小星星变奏曲.mp3 -------------------------------------------------------------------------------- /p/2014/06/mom/sounds/莫扎特 - 小星星变奏曲.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/sounds/莫扎特 - 小星星变奏曲.ogg -------------------------------------------------------------------------------- /p/2014/06/mom/style.css: -------------------------------------------------------------------------------- 1 | /** 2 | * toolbar 3 | * git@github.com:maxogden/toolbar.git 4 | * @author Max Ogden / max@maxogden.com 5 | */ 6 | /* modified by h5-Lium / http://weibo.com/hellolium */ 7 | 8 | /* Hard reset 9 | -------------------------------------------------- */ 10 | html, body, div, nav, ul, li, img { 11 | padding: 0; 12 | margin: 0; 13 | border: 0; 14 | border: none; 15 | } 16 | 17 | .hidden { 18 | display: none; 19 | } 20 | 21 | [class*="bar-"] { 22 | position: fixed; 23 | right: 0; 24 | left: 0; 25 | z-index: 10; 26 | height: 44px; 27 | padding: 5px; 28 | -webkit-box-sizing: border-box; 29 | -moz-box-sizing: border-box; 30 | } 31 | 32 | body, #container, #screen { 33 | overflow: hidden; 34 | -webkit-user-select: none; 35 | -moz-user-select: none; 36 | } 37 | 38 | #stats { 39 | position: absolute; 40 | top: 0; 41 | } 42 | 43 | /* crosshair */ 44 | #crosshair { 45 | position: fixed; 46 | top: 50%; 47 | left: 50%; 48 | margin: -16px 0 0 -16px; 49 | width: 32px; 50 | height: 32px; 51 | } -------------------------------------------------------------------------------- /p/2014/06/mom/textures/bedrock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/bedrock.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/blockDiamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/blockDiamond.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/bluewool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/bluewool.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/brick.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/cobblestone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/cobblestone.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/crate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/crate.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/diamond.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/dirt.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/glowstone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/glowstone.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/grass.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/grass_dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/grass_dirt.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/ice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/ice.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/bluewoolicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/bluewoolicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/brickicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/brickicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/cobblestoneicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/cobblestoneicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/diamondicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/diamondicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/glowstoneicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/glowstoneicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/netherrackicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/netherrackicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/obsidianicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/obsidianicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/plankicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/plankicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/redwoolicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/redwoolicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/icons/whitewoolicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/icons/whitewoolicon.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/netherrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/netherrack.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/obsidian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/obsidian.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/opaque.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/opaque.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/plank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/plank.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/redwool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/redwool.png -------------------------------------------------------------------------------- /p/2014/06/mom/textures/whitewool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/06/mom/textures/whitewool.png -------------------------------------------------------------------------------- /p/2014/06/myotee-talk.md: -------------------------------------------------------------------------------- 1 | ## 闲谈脸萌 2 | 3 | *2014-06-11* 4 | 5 | 最近一款叫“脸萌”的手机应用爆红。它诞生在深圳宝安一间出租屋内,一个八九人的小团队,颇具励志性。 6 | 7 | 下载体验后,我和部分网友一样,原以为能够根据照片自动生成,结果只是纯手工挑选。而且可供挑选的种类有限,以及种类之间存在冲突,感到有点失望。 8 | 9 | 然而,如果他们的理念是实话,我欣赏他们。应用目前是我所喜欢的专一工具类应用,致力于为用户创造卡通形象,无水印(已移除),无广告,称得上绿色。 10 | 11 | > 我们就算饿死也不会往脸萌加广告。 12 | 13 | 我很认同郭列。做App用户体验最重要,如果你尊重用户并心存感激的话,那就不要让他们反感。相比赚钱,良好的口碑更值得。 14 | 15 | 今天更新到v2.3.0,新增了“双人模式”,新增了世界杯主题的装饰,都是非常到位的跟进。如果他们继续MIUI的一周一迭代,相信会再走一段路。多远,我不知道。 16 | 17 | “设计大于技术”的应用,如果是这样,我会为他们祈祷。 18 | 19 | 参考: 20 | 21 | - [CEO郭列的知乎回答](http://www.zhihu.com/question/24004857/answer/26441914) 22 | - [爆红的脸萌:卖萌能持续多久](http://tech.sina.com.cn/i/2014-06-11/03109429738.shtml) 23 | - [“脸萌”类APP陷入怪圈:一夜爆红后销声匿迹](http://tech.sina.com.cn/i/2014-06-09/11099425649.shtml) 24 | -------------------------------------------------------------------------------- /p/2014/08/IMG_20140824_150017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/08/IMG_20140824_150017.jpg -------------------------------------------------------------------------------- /p/2014/08/e6c88c821a944f8da86cd899a44e73ad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/08/e6c88c821a944f8da86cd899a44e73ad.jpg -------------------------------------------------------------------------------- /p/2014/08/mmexport1408888984123.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/08/mmexport1408888984123.jpg -------------------------------------------------------------------------------- /p/2014/08/profile_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/08/profile_square.png -------------------------------------------------------------------------------- /p/2014/08/weekend-01.md: -------------------------------------------------------------------------------- 1 | # 深圳码农周末 第一辑 2 | 3 | *2014-08-24* 4 | 5 | 剑伯、昌爷还有我,周日欢乐海岸 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /p/2014/09/bug/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/09/bug/close.png -------------------------------------------------------------------------------- /p/2014/09/bug/gulp-plugins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/09/bug/gulp-plugins.png -------------------------------------------------------------------------------- /p/2014/09/bug/notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/09/bug/notification.png -------------------------------------------------------------------------------- /p/2014/09/bug/reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/09/bug/reference.png -------------------------------------------------------------------------------- /p/2014/09/bug/thanks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/09/bug/thanks.png -------------------------------------------------------------------------------- /p/2014/10/QQ图片20141022210533.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/10/QQ图片20141022210533.jpg -------------------------------------------------------------------------------- /p/2014/10/QQ图片20141022210537.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/10/QQ图片20141022210537.jpg -------------------------------------------------------------------------------- /p/2014/10/QQ图片20141022214120.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2014/10/QQ图片20141022214120.jpg -------------------------------------------------------------------------------- /p/2014/10/_house-clean.md: -------------------------------------------------------------------------------- 1 | # 收拾屋子 2 | 3 | *2014-10-04* 4 | 5 | “深圳码农周末(番外篇)”结束后,奔波了大半天的我回到了家里,从房间出来时,我问妈妈:“那个‘蛋’是不是扔了?” 6 | 7 | 她说是,后来我又得知我刚买的小米配件的盒子也被清理了,拿出了一些认为我还要的东西。我说少了,还有东西也被扔了: 8 | 9 | - “蛋”里剩下的玩具贴纸和说明书。这是我在公司实习的最后一天得到的小奖品,是组内成员对我的认可,颇具纪念意义。 10 | 11 | - 小米配件,盒子里剩下的手机贴膜、“耳机备用套”等。 12 | 13 | ## 妈妈说 14 | 15 | - 我今天是心情好,才难得收拾了东西 16 | - 你应该提前告诉她哪些东西不该扔 17 | - 那个盒子随便放在了外面 18 | - 那袋垃圾还没扔,就在家里 19 | 20 | ## 我想说 21 | 22 | - 我知道你今天是心情好,才收拾了东西,这是好事,但就是收拾掉了有用的东西 23 | - 我不可能每带回一样东西,都要解释它不该扔吧 24 | - 放不放在自己房间都一样,那个放在“蛋”还不是被扔了 25 | - 有些东西都已经掉出来了,如“耳机备用套”等 26 | 27 | ## 结语 28 | 29 | 清理东西是好事,这次我也不是觉得自己亏了多少。但是对于这类**不太可逆**的操作,在做之前,最好还是先确认一下。 30 | 31 | 最后,我忍辱负重,发扬了勤俭节约的传统美德,捡回了约30元的贴膜;但对于那个“蛋”实在没办法,我一气之下还是将那赤裸的“摩托车”扔了进去……就这样吧。 -------------------------------------------------------------------------------- /p/2014/10/free-your-html-body-tags.md: -------------------------------------------------------------------------------- 1 | # Free Your HTML/BODY Tags 2 | 3 | *2014-10-23* 4 | 5 | Today my leader asked me why the topbar on mobile [Qiushibaike](http://qiushibaike.com) covered page contents, while it should not. 6 | 7 | 8 |    9 | 10 | 11 | I quickly looked into the problem, with the git log showed no big deals, I suddenly found it was a line of css that had been unexpectedly overwriten. 12 | 13 | 14 | 15 | Finally, leader pointed out it was an external script, probably advertisement stuff, that produced such nonsense css code which overwrites. A quick solution though, is to add an `!important` flag. 16 | 17 | With complaint of those evil external scripts, we had also noticed our abuse on `` tag. These tags should not be **over-depended** any more, while they are usually of easy accesses. 18 | 19 | So, free your html and body tags! Make sure you have a `.container` stuff or someting. 20 | -------------------------------------------------------------------------------- /p/2014/11/self-indentification.md: -------------------------------------------------------------------------------- 1 | # 自我鉴定 2 | 3 | *2014-11-08* 4 | 5 | > 学校要求填写的,毕业就业推荐表中,简单的自我鉴定。 6 | 7 | ## 学习 8 | 9 | 在校期间,我将不少精力花在WEB开发这一爱好上,只能说课程学习态度中上,成绩一般,但项目实践能力过人。 10 | 11 | ## 生活 12 | 13 | 我爱好户外运动,如篮球和轮滑;乐观开朗,热衷在各类兴趣小组结交好友;同时勤俭节约,毕竟父母赚钱不容易。 14 | 15 | ## 思想 16 | 17 | 我是完美主义,也是常说的像素主义,对自己对项目有高敏感高要求,精益求精。 18 | 19 | ## 工作 20 | 21 | 在校期间,我参与的工作主要有: 22 | 23 | - 2013年4月,加入袂卓工作室技术部 24 | - 2013年6月,参与江门社保管控平台项目,WEB前端开发 25 | - 2014年7月,加入糗事百科APP组,WEB前端开发实习 26 | - 2014年10月,受聘担任科技孵化中心学长培训师一年 27 | 28 | 充足的工作经历,给予了我项目经验和团队精神。 29 | -------------------------------------------------------------------------------- /p/2015/01/fs-auth.md: -------------------------------------------------------------------------------- 1 | # Why I built fs-auth and how it works 2 | 3 | *2015-01-11* 4 | 5 | Several days ago I created a tool, which was named [fs-auth](https://github.com/fritx/fs-auth) and titled "auth beyond filesystem". That was an early idea. 6 | 7 | 1. In the beginning, I wanted to upload projects onto Github, with some sensitive files included (inappropriate but convinient, though), such as **connection config** or **password stuff**. 8 | 1. Later on, I wanted to encrypt, you know, some **personal files**. 9 | 1. Recently, I wanted to implement a file-based db (something like [lowdb](https://github.com/typicode/lowdb)), but with **user authentication**. 10 | 11 | But I'd never figured out a way that is flat and straightforward, until fs-auth: 12 | 13 | - encrypts files with passwords given 14 | - auths and decrypts files with correct passwords 15 | - fails auth with incorrect passwords 16 | 17 | ![overview](fs-auth/overview.png) 18 | 19 | ## So how does it work? 20 | 21 | Here are our needs: 22 | 23 | 1. With a password required, original files get encrypted. 24 | 2. Encrypted files could verify the correct password. 25 | 3. With the correct password, encrypted files could be decrypted. 26 | 4. The password could not be figured out from encrypted files. 27 | 5. Even with original files, the password could not be figured out. 28 | 29 | ### Password Verification 30 | 31 | We **hash the password** and prepend it to the encrypted file, for later verification. 32 | 33 | ![auth](fs-auth/auth.png) 34 | 35 | Note that barely md5 is not safe enough. We use **combinations** of md5 and sha1 instead. 36 | 37 | ### Contents Encrypting/Decrypting 38 | 39 | While encrypting, we shift each bit (simply increase its value) of file contents, using **another hash of the password** as key. While decrypting, we unshift (decrease) it. 40 | 41 | ![shift](fs-auth/shift.png) 42 | 43 | ## Entire Flows 44 | 45 | ### File Locking 46 | 47 | ![encrypt](fs-auth/encrypt.png) 48 | 49 | ### File Auth 50 | 51 | ![decrypt](fs-auth/decrypt.png) 52 | -------------------------------------------------------------------------------- /p/2015/01/fs-auth/auth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/01/fs-auth/auth.png -------------------------------------------------------------------------------- /p/2015/01/fs-auth/decrypt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/01/fs-auth/decrypt.png -------------------------------------------------------------------------------- /p/2015/01/fs-auth/encrypt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/01/fs-auth/encrypt.png -------------------------------------------------------------------------------- /p/2015/01/fs-auth/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/01/fs-auth/overview.png -------------------------------------------------------------------------------- /p/2015/01/fs-auth/shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/01/fs-auth/shift.png -------------------------------------------------------------------------------- /p/2015/01/use-n0gx.md: -------------------------------------------------------------------------------- 1 | # 使用n0gx进行内部转发 2 | 3 | *2015-01-05* 4 | 5 | ## 背景 6 | 7 | 什么是反向代理?平时所说的代理是为客户端做中介,隐藏的是客户端的身份;而反向代理则是为服务端做中介,正好相反,其功能包括内部转发(Inner Forwarding)、安全过滤、负载均衡等等。 8 | 9 | 对于我的vps来说,暂时只用到了内部转发: 10 | 11 | - /static 静态到 ~/dev/static 12 | - /voice1min 派遣到 监听3099端口的唱吧 13 | - /blog 重定向到 github上的blog 14 | - 404 重定向到 /blog 15 | 16 | nginx配置看着蛋疼,我一直想用node实现一个,于是有了[n0gx](https://github.com/fritx/n0gx)。 17 | 18 | ## n0gx的原理 19 | 20 | 将这里用到的内部转发归纳为三点: 21 | 22 | - 静态(static) 23 | - 重定向(redirect) 24 | - 派遣(dispatch) 25 | 26 | n0gx的工作方式: 27 | 28 | - 从json/js文件中读取配置 29 | - 由express支撑web服务 30 | - express顺带提供static/redirect支持 31 | - 另由http-proxy提供dispatch支持 32 | 33 | ## n0gx的使用 34 | 35 | n0gx更多的是作为命令行工具使用,npm全局安装: 36 | 37 | ```shell 38 | $ npm i -g n0gx 39 | ``` 40 | 41 | 这是个简单的[配置样例](https://github.com/fritx/n0gx/blob/master/example): 42 | 43 | ```js 44 | // n0gx.conf.json 45 | { 46 | "static": { 47 | "/static": "./example/static" 48 | }, 49 | "dispatch": { 50 | "/voice1min": "http://fritx.me/voice1min", 51 | "/blog_local": "http://127.0.0.1:8080/blog" 52 | }, 53 | "redirect": { 54 | "/blog": "http://fritx.me/blog" 55 | }, 56 | "404": "/blog", 57 | "listen": 80 58 | } 59 | ``` 60 | 61 | 启动n0gx: 62 | 63 | ```shell 64 | $ n0gx ./n0gx.conf 65 | ``` 66 | 67 | 如果你使用pm2管理node进程: 68 | 69 | ```shell 70 | $ which n0gx 71 | > /root/local/bin/n0gx 72 | $ pm2 start /root/local/bin/n0gx -- ./n0gx.conf 73 | ``` 74 | 75 | [Unitech/PM2#917](https://github.com/Unitech/PM2/issues/917#issuecomment-68645387)我已经提了,相信不久后就可以直接: 76 | 77 | ```shell 78 | $ pm2 start n0gx -- ./n0gx.conf 79 | ``` 80 | 81 | ## 结语 82 | 83 | 这是效果: 84 | 85 | - 派遣到 3099端口上的唱吧 86 | - 重定向到 github上的blog 87 | - 重定向到 /blog 88 | - 404依然重定向 /blog 89 | 90 | n0gx纯属个人爱好。论性能和功能齐全,比不上nginx,还是老老实实地去学吧。 91 | 92 | ## 参考阅读 93 | 94 | - [抛弃Nginx使用nodejs做反向代理服务器](http://www.jb51.net/article/52256.htm) 95 | - [nginx 配置从零开始](http://www.kuqin.com/shuoit/20141229/344156.html) 96 | - [NodeJS on Nginx: 使用nginx反向代理处理静态页面](http://ourjs.com/detail/nodejs-on-nginx-%E4%BD%BF%E7%94%A8nginx%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86%E5%A4%84%E7%90%86%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2) 97 | -------------------------------------------------------------------------------- /p/2015/01/why-no-semicolon.md: -------------------------------------------------------------------------------- 1 | # Why I don't write a semi 2 | 3 | *2015-01-07* 4 | 5 | I've been asked for several times why I don't write down a semicolon, after each statement in my JavaScript. 6 | 7 | Most of the time it doesn't even worth a word to answer. In other words, I can't find any reason to do that anymore. 8 | 9 | Yes, in languages like Java even PHP, semicolons are required. But in JavaScript, they are **optional**. 10 | 11 | The below are the reasons why I finally switched to the no-semicolon style: 12 | 13 | 1. It saves effort 14 | 15 | Why do I bother myself to type while I don't have to? 16 | 17 | 1. Code becomes clear 18 | 19 | Semicolons are such irrelevant stuff. Also, a newline already indicates a break. 20 | 21 | 1. It is **npm** Coding Style 22 | 23 | See *Semicolons* Section [here](https://docs.npmjs.com/misc/coding-style) for more 24 | 25 | 1. It is reliable and applied 26 | 27 | Not like that unreliable as argued somewhere, actually it's been applied in some popular projects, from backend to frontend such as [npm/npm](https://github.com/npm/npm), [request/request](https://github.com/request/request), [madrobby/zepto](https://github.com/madrobby/zepto), [yyx990803/vue](https://github.com/yyx990803/vue). 28 | 29 | No-semicolon style does not mean "no semicolon at all", instead, it means "write only when required". Do not forget to prepend a semicolon for those lines with leading `(`, `[`, `/`, `+`, `-`. 30 | 31 | Here is [another article](https://mislav.net/2010/05/semicolons/), by Mislav, stuff in Github. 32 | -------------------------------------------------------------------------------- /p/2015/03/_memory-bgm.md: -------------------------------------------------------------------------------- 1 | # 追念(BGM篇) 2 | 3 | *2015-03-28* 4 | 5 | > 那些年玩过的游戏,听过的BGM…… 6 | 7 | 生病请假有一个好处,就是可以像周末一样自在,每天和父母出门散步至少两趟。 8 | 9 | 在商场里,音响播着魔幻版的乐曲,身子虚弱,不由自主地多愁善感、浮想联翩起来。我经常这样。这回略有不同,我的思绪集中在了儿时的那些游戏BGM上。我想一口气把回忆都找回来。 10 | 11 | 我玩的游戏不多,基本上都是和同学一起玩网游。我听的音乐不多,大多时候喜欢纯音乐伴奏。 12 | 13 | 我第一次感到游戏BGM美妙,应该是QQ飞行岛吧,纯正的西欧交响乐曲,当时我课堂上演示的ppt中就盗用了两首。或者也可能是再早的DNF,当时我有那么几个场景的音乐特好听,由其是“西海岸”,后来我还把他们从游戏文件里挑选出来,加进了KuGou…… 14 | 15 | 以前我已先后多次一时兴起,刻意地搜寻某个游戏的BGM,导入KuGou,但都是短期的、分散的。这次我算是疯了,BGM觉得好的,都一并找出来了,比如:泡泡堂、石器时代、魔力宝贝、梦幻西游、DNF、QQ飞行岛、QQ三国。 16 | 17 | 这里记下资源地址,如果你有需要,好人一生平安: 18 | 19 | - [泡泡堂(渣渣地方)](http://www.mtv123.com/zhuanjilist/39081.shtml​) 20 | - [石器时代(原声)](http://pan.baidu.com/share/link?shareid=557339&uk=2533850720​) 21 | - [魔力宝贝(原声)](http://115.com/file/b4lxfh72) 22 | - [梦幻西游(官方)](http://xyq.163.com/download/down_music.html​) 23 | - [QQ三国(原声)](http://yun.baidu.com/share/link?shareid=678351654&uk=2786027226) 24 | - DNF、QQ飞行岛(游戏文件里有,日后再说) 25 | -------------------------------------------------------------------------------- /p/2015/03/to-jayin.md: -------------------------------------------------------------------------------- 1 | # 写给英爷的一封信 2 | 3 | *2015-03-28* 4 | 5 | > 如果问我大学里有哪些遗憾,那么“邑大唱吧”项目将是一个。 6 | 7 | 两年前的这个时候,我被剑剑带进了工作室,接触到了其他一些大神,英爷就是一个。 8 | 9 | 当时英爷很潮,为他那叱咤校园的课程表应用,办了个微信公众号(ETips_邑点通)。当时还属于一个空壳号,无实质功能,微信开发、拼凑功能迫在眉睫。于是我也帮忙添砖加瓦,搞了个“山寨小黄鸡”上去(与机器人聊天)。 10 | 11 | 随后,也是应英爷提议,我开发了“微信唱吧”应用(由微信公众号接收用户语音,并上榜),共同取名“邑大唱吧”,再一次接入了ETips公众号,向校内同胞推广。从原滋原味的文字版,到含扁平化UI的网页版。 12 | 13 | 其实我非常感谢英爷,出于他的先见之明和社会道义,我得以有幸推广这款应用,面对280名微信用户(当时数据),收获120首歌曲。也感谢那些所有的支持唱吧的小伙伴。 14 | 15 | 这是我能百度出来的,英爷前后两次发表的吧帖: 16 | 17 | - [你的歌声你做主,ETips开发团队最新推出"邑大唱吧" (2013-10-15)](https://tieba.baidu.com/p/2651048791) 18 | - ~~[邑大唱吧全新上线咯! (2013-10-29)](https://tieba.baidu.com/p/2676405006)~~ 19 | 20 | 好景不长,也不知到了哪个时候,BAE2强制迁移到3,加之当时年少无知缺少责任感,唱吧索性关停歇业。从此我与这些用户失之交臂。 21 | 22 | 一年之后,也就是上学期初,出于毕业设计,邑大唱吧归来。新的服务器(个人VPS),新的公众号(一分钟歌声),甚至git仓库由[wyu-sing](https://github.com/fritx/wyu-sing) 改成了~~1min~~ [wxchangba](https://github.com/fritx/wxchangba) ……然而,用户仅增至80名,歌曲仅29首(公众号接收仅9首),很难搞得起来。 23 | 24 | 无论是邑大唱吧,还是xx唱吧,这样一个区域性质的文娱平台,我一直觉得是个很不错的点子。虽然它存在这一些硬伤,比如: 25 | 26 | - 微信语音音质差 27 | - 微信语音时限一分钟 28 | - 需要向公众号发送语音 29 | 30 | 但我个人认为问题都不大,许多缺陷均可巧妙转化为优势和亮点,比如“一分钟”,一分钟已经足够。 31 | 32 | 于邑大唱吧,英爷不当Co-Founder那也是个干爹,在此我诚邀英爷(重新)加入该项目,达成更多沟通与合作,我定倾其所能。目的只有一个,就是将“邑大唱吧”这个概念发扬光大。 33 | 34 | 我将率先作以下承诺: 35 | 36 | - 稳定的服务器 37 | - 恢复历史歌曲数据 38 | - 前/后端性能优化 39 | - 有效的百度统计 40 | - 一起深度探讨产品 41 | - 如果你需要,可随时接入任何公众号 42 | 43 | 期待着你的加入。 44 | 45 | ——亮爷 46 | -------------------------------------------------------------------------------- /p/2015/04/_respdesign/1min-song-md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/1min-song-md.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/1min-song-xs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/1min-song-xs.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/711.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/711.jpg -------------------------------------------------------------------------------- /p/2015/04/_respdesign/bec-boss-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/bec-boss-sm.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/bec-boss-sm1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/bec-boss-sm1.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/bec-boss-xs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/bec-boss-xs.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/bec-caselist-md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/bec-caselist-md.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/bec-caselist-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/bec-caselist-sm.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/bec-caselist-xs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/bec-caselist-xs.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/blog-post-md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/blog-post-md.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/blog-post-xs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/blog-post-xs.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp') 2 | var imagemin = require('gulp-imagemin') 3 | 4 | gulp.task('imagemin', function(){ 5 | gulp.src('*.{png,jpg}') 6 | .pipe(imagemin({ 7 | progressive: true 8 | })) 9 | .pipe(gulp.dest('.')) 10 | }) 11 | 12 | gulp.task('default', ['imagemin']) 13 | -------------------------------------------------------------------------------- /p/2015/04/_respdesign/index.md: -------------------------------------------------------------------------------- 1 | # 响应式设计之路 2 | 3 | *2015-04-20* 4 | 5 | 10年web开发经历,对web有一定见解。 6 | 7 | ![711](711.jpg) 8 | 9 | ## 响应式由来,概述,现状 10 | 11 | 12 | 13 | > 响应式网页设(RWD)是[Ethan Marcotte在去年5月份提出的一个概念](http://alistapart.com/article/responsive-web-design),简而言之,就是一个网站能够兼容多个终端——而不是为每个终端做一个特定的版本。这个概念可以说是是为移动互联网而生的! 14 | 15 | (摘自:[响应式网页设计 - 前端观察](http://www.qianduan.net/responsive-web-design/)) 16 | 17 | - [国内优秀的响应式WEB网站有哪些? - 知乎](http://www.zhihu.com/question/21073212) 18 | 19 | ### 屏幕尺寸分类 20 | 21 | - 767px及以下:超小屏幕(xs),手机 22 | - 768px~991px:小屏幕(sm),平板 23 | - 992px~1199px:中屏幕(md),桌面 24 | - 1200px及以上:大屏幕(lg),大桌面 25 | 26 | (摘自:[bootstrap栅格系统](http://v3.bootcss.com/css/#grid>)) 27 | 28 | ### 适配方向 29 | 30 | - 小屏 << 中屏 << 大屏 31 | - 小屏 >> 中屏 >> 大屏(移动优先) 32 | - 小屏 << 中屏 >> 大屏 33 | 34 | ### 响应式分级 35 | 36 | - 基础响应式:内容完整呈现 37 | - 进阶响应式:+基本美感协调 38 | - 高级响应式:+全方位+人性化+强设计 39 | 40 | ## 响应式设计模式 41 | 42 | - 高宽伴随/设限 43 | - 流式/百分比 44 | - 字体大小 45 | - 边距/留白 46 | - 列数增减 47 | - 板块排布 48 | - 部件改编 49 | 50 | ### 高宽伴随/设限,边距/留白,字体大小 51 | 52 | 53 |      54 | 55 | 56 | (演示:[邑大唱吧](http://1min.fritx.me),源码:[fritx/1min](https://github.com/fritx/1min)) 57 | 58 | ### 流式/百分比,板块排布 59 | 60 | 61 | 62 | (摘自:[silent博客框架](../../../projects/silent/),演示:[Fritx' Blog](http://fritx.github.io/blog/),源码:[fritx/blog](https://github.com/fritx/blog)) 63 | 64 | ### 列数增减 65 | 66 | 67 |      68 | 69 | 70 | 71 | 72 | (演示:[深圳商擎顾问](https://bec.today/),源码:[fritx/sites](https://github.com/fritx/sites)) 73 | 74 | ### 部件改编(1) 75 | 76 | 77 |      78 | 79 | 80 | ### 部件改编(2) 81 | 82 | 83 |      84 | 85 | 86 | 87 | 88 | ## 谢谢! 89 | 90 | - [《响应式设计之路》博客原文](http://fritx.github.io/blog/?2015/04/respdesign/) 91 | - [《响应式设计之路》演说幻灯片](http://fritx.github.io/blog/p/2015/04/respdesign/index.md.html) 92 | 93 | ## 拓展阅读 94 | 95 | - [国内优秀的响应式WEB网站有哪些? - 知乎](http://www.zhihu.com/question/21073212) 96 | - [5 Really Useful Responsive Web Design Patterns](http://designshack.net/articles/css/5-really-useful-responsive-web-design-patterns/) 97 | - [Responsive Web Design Patterns](https://developers.google.com/web/fundamentals/layouts/rwd-patterns/mostly-fluid?hl=en) 98 | - [##响应式设计## - 在线云频道](http://channel.fritx.me/channels/ca4a1e99-65da-48de-9195-2a8cebfdb9a9) 99 | -------------------------------------------------------------------------------- /p/2015/04/_respdesign/ppt_/ppt.css: -------------------------------------------------------------------------------- 1 | .animated { 2 | -webkit-animation-duration: .5s; 3 | animation-duration: .5s; 4 | } 5 | 6 | html, body { 7 | margin: 0; 8 | padding: 0; 9 | width: 100%; 10 | height: 100%; 11 | overflow: hidden; 12 | position: relative; 13 | } 14 | body { 15 | font-family: "Helvetica neue",Helvetica,Tahoma,"lantinghei sc","Microsoft Yahei", sans-serif; 16 | /*word-break: break-word;*/ 17 | word-break: break-all; 18 | } 19 | img { 20 | max-width: 100%; 21 | } 22 | * { 23 | -ms-box-sizing: border-box; 24 | -o-box-sizing: border-box; 25 | -moz-box-sizing: border-box; 26 | -webkit-box-sizing: border-box; 27 | box-sizing: border-box; 28 | } 29 | 30 | pre, table { 31 | display: block; 32 | overflow: auto; 33 | width: 100%; 34 | } 35 | pre { 36 | word-break: break-all; 37 | } 38 | 39 | body>div { 40 | position: relative; 41 | width: 100%; 42 | height: 100%; 43 | background-color: #f8f8f8; 44 | } 45 | 46 | section { 47 | position: absolute; 48 | top: 0; 49 | bottom: 0; 50 | left: 0; 51 | right: 0; 52 | visibility: hidden; 53 | font-family: "Microsoft Yahei"; 54 | font-size: 140%; 55 | word-break: break-word; 56 | } 57 | 58 | section>div { 59 | padding: 1px; /* hack */ 60 | /*box-sizing: content-box;*/ 61 | width: 100%; 62 | } 63 | section>div img { 64 | -webkit-box-shadow: 0 0 6px rgba(0,0,0, .6); 65 | -moz-box-shadow: 0 0 6px rgba(0,0,0, .6); 66 | -ms-box-shadow: 0 0 6px rgba(0,0,0, .6); 67 | -o-box-shadow: 0 0 6px rgba(0,0,0, .6); 68 | box-shadow: 0 0 6px rgba(0,0,0, .6); 69 | } 70 | -------------------------------------------------------------------------------- /p/2015/04/_respdesign/screens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/screens.png -------------------------------------------------------------------------------- /p/2015/04/_respdesign/silent-screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/04/_respdesign/silent-screenshots.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/maxwidth-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/maxwidth-0.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/maxwidth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/maxwidth-1.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/scale08-0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/scale08-0.jpg -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/scale08-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/scale08-1.jpg -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/scale09-0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/scale09-0.jpg -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/scale09-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/scale09-1.jpg -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/tablecell-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/tablecell-0.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/tablecell-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/tablecell-01.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticalmid-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticalmid-0.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticalmid-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticalmid-01.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticalmid-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticalmid-10.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticalmid-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticalmid-11.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticalmid-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticalmid-12.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticalmid-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticalmid-13.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticaltop-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticaltop-10.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticaltop-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticaltop-11.png -------------------------------------------------------------------------------- /p/2015/05/_channel-dev-together-01/verticaltop-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/_channel-dev-together-01/verticaltop-12.png -------------------------------------------------------------------------------- /p/2015/05/silent-one-year-old/chang.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/silent-one-year-old/chang.jpg -------------------------------------------------------------------------------- /p/2015/05/silent-one-year-old/derek.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/silent-one-year-old/derek.jpg -------------------------------------------------------------------------------- /p/2015/05/silent-one-year-old/index.md: -------------------------------------------------------------------------------- 1 | # 🎉 silent项目一周年 2 | 3 | *2015-05-09* 4 | 5 | > silent不是我在github的第一个项目,但绝对是生命力最持久,收获眼球最多的一个。 6 | 7 | ![si1ent](../../../projects/silent/pic/si1ent.png) 8 | 9 | (Designed by: **@huangruichang**) 10 | 11 | [silent][1]是什么?**silent是一款极简的轻量级静态博客框架**,拥有自己的一套载入机制和“哲学”。 12 | 13 | silent开启了我的极简主义之路,从此一发不可收拾,我的大脑无法再接收复杂的东西。 14 | 15 | 可以说,silent伴我走过了大学里几乎是最后的一段时光,充满艰辛和回味的一年,始终和我一同成长着。从最初的宿舍楼范围内的苦力推销,到如今我欣慰地看到,silent思想被越来越多的人接纳和传扬。 16 | 17 | 18 | 19 | 那么,就让我们回顾一下silent的历程吧: 20 | 21 | 去年5月8日,我发布了[silent][1]的第一个版本,还有我自己的博客([fritx.github.io/blog][3]) 22 | 23 | 5月9日,**@IamJayden**同学使用silent搭建了博客([IamJayden.github.io][4]) 24 | 25 | 5月14日,**@jacsonLee**同学使用silent搭建了博客([jacsonLee.github.io/Blog][5]) 26 | 27 | 5月19日,**@huangruichang**同学使用silent搭建了博客([huangruichang.github.io][6]) 28 | 29 | 5月24日,路人**@7c00**使用silent搭建了博客([7c00.github.io/b14][9]),并一度对silent进行了客观评价(值得思考) 30 | 31 | 9月11日,同事**@Derekgame2013**使用silent搭建了博客([Derekgame2013.github.io/blog][7]) 32 | 33 | 10月14日,**@Jayin**同学发布了silent的又一分支[silentor][2],搭建了博客([Jayin.github.io][8]),助力silent传承。 34 | 35 | 非常感谢,silent与你同在! 36 | 37 | 47 | 48 |    49 | 50 |    51 | 52 |    53 | 54 |    55 | 56 |    57 | 58 | 59 | 其实silent这个词(静默),跟我本人有着很大的对比。我有着一个高调的、热衷于装逼的性格。我时常为了点技术的事跟人争得不可开交,我还时常急于把尚不明确的点子与人分享,每写出一点代码,我就会大肆宣扬,巴不得所有人都看见。 60 | 61 | 但正是这种狂傲不羁的性格,驱使着我在开源的道路上不断前行。到现在,[我在github][10]已经发布了58份代码,收获57颗星,29次fork。装逼无罪,如果你足够热爱,那么请你尽情释放,做张扬的自己。 62 | 63 | 然而眼下,有那么一些事情正等着我去做,我知道,有些机会我必须把握。如果一些事情对你来说非常重要,那么也请你低调地把它做好!我是林亮,我为silent代言。 64 | 65 | [1]: ../../../projects/silent/ 66 | [2]: https://github.com/Meizhuo/silentor 67 | [3]: https://fritx.github.io/blog/ 68 | [4]: https://IamJayden.github.io 69 | [5]: https://jacsonLee.github.io/Blog/ 70 | [6]: https://huangruichang.github.io 71 | [7]: https://Derekgame2013.github.io/blog/ 72 | [8]: https://Jayin.github.io 73 | [9]: https://7c00.github.io/b14/ 74 | [10]: https://github.com/fritx 75 | -------------------------------------------------------------------------------- /p/2015/05/silent-one-year-old/jacson.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/silent-one-year-old/jacson.jpg -------------------------------------------------------------------------------- /p/2015/05/silent-one-year-old/jayden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/silent-one-year-old/jayden.png -------------------------------------------------------------------------------- /p/2015/05/silent-one-year-old/jayin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/silent-one-year-old/jayin.jpg -------------------------------------------------------------------------------- /p/2015/05/silent-one-year-old/silent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/silent-one-year-old/silent.png -------------------------------------------------------------------------------- /p/2015/05/silent-one-year-old/todd.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/05/silent-one-year-old/todd.gif -------------------------------------------------------------------------------- /p/2015/06/2014-11-24 141334.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/06/2014-11-24 141334.jpg -------------------------------------------------------------------------------- /p/2015/06/800-600.46d7d7c6174f9db0faa20f13ac4013c95b29c778_stxt_63_stxt1_t.d0c6ba.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/06/800-600.46d7d7c6174f9db0faa20f13ac4013c95b29c778_stxt_63_stxt1_t.d0c6ba.jpg -------------------------------------------------------------------------------- /p/2015/06/_about-acadamy.md: -------------------------------------------------------------------------------- 1 | # 关于学术论文 2 | 3 | *2015-06-01* 4 | 5 | ## 一、论文格式 6 | 7 | 很多人都在哭喊,论文格式难调啊,行距、字体、标题、目录等等,平时word操作经验不足,更何况掺杂了内容还有格式的二进制word哪还有版本控制一说? 8 | 9 | 痛苦,问:为何要有“学术论文写作规范”? 10 | 11 | 这让我联想到,“如何看待规范(标准)”的话题。 12 | 13 | 当然,这是我曾经对自己提的一个问题。我读的书是真的少,如有雷同,那也绝非抄袭,纯属个人思考成果。 14 | 15 | 自问: 16 | 17 | 1. 标准到底是什么? 18 | 2. 我们真的需要标准吗? 19 | 20 | 自答: 21 | 22 | 1. 标准是把一些东西总结出来,供后人参考,甚至强迫后人服从,如刑法判定,如度量单位,如课本里头的标准答案。 23 | 2. 24 | 25 | ## 二、论文查重 26 | 27 | ## 结论 28 | 29 | 额,先不说了,我还是去知网查查吧。 30 | 31 | OK, stop here. I am gonna go CNKI for a try first. 32 | 33 | ## 参考资料 34 | 35 | [1]: 论文查重乱象背后的“生意经” http://www.jyb.cn/high/gjsd/201409/t20140903_596392.html 36 | -------------------------------------------------------------------------------- /p/2015/06/campus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/06/campus.jpg -------------------------------------------------------------------------------- /p/2015/06/graduation-thanks.md: -------------------------------------------------------------------------------- 1 | # 🎓 亮爷的毕业致谢 2 | 3 | *2015-06-06* 4 | 5 | 在我的毕业论文即将完成之际,我想要好好地感谢,感谢那些陪伴过我、支持过我的人。 6 | 7 | 感谢我的父母,感谢你们对我充满信心,尊重并且支持着我的决定,还有就是朋友般无话不谈的沟通方式,让我在家中也能够吹牛和释放自己。 8 | 9 | 感谢我的母校五邑大学,是你收留并孕育了我,如今的我会自豪的说出:我是邑大人。感谢在这里教育过我的老师们,感谢我的班导曹彩凤老师。感谢16栋,育英楼。 10 | 11 | 12 | 13 | 感谢我的指导老师王柱老师,在您的指导下我们最终攻克了毕业设计及论文;也是您,两年前带领我们加入社保项目组,开启了我们的打工之路。 14 | 15 | 感谢社保项目组的易院长、刘老师、吴老师、师兄师姐们,有你们关照真好,我很想念那个顶着绵绵细雨,跨越大半个校园才能来到的研发室。 16 | 17 | 感谢我的实习单位糗事百科,感谢HR韬哥约我,组长樊老板带我极客带我飞,感谢APP组。享受小伙伴们的欢声笑语,舒适的工作环境使我满足。感谢你们接纳稚嫩的我。 18 | 19 | 20 | 21 | 22 | 23 | 感谢剑剑,没有你,锐斧小组不会加入袂卓工作室;没有你,就没有思源项目的整个过程。在袂卓我们收获了太多。对了,深圳码农周末等你归来。 24 | 25 | 26 | 27 | 感谢智峣和涌鑫,每当看见卫生巾和月饼我就会想起你们。做闺蜜专卖、江门邮政商城很艰辛,却也很快乐,它们永远是我心目中最可爱的产品。感谢袂卓的所有小伙伴。 28 | 29 | 感谢英爷,没有你,也就没有当年的邑大唱吧;没有你,就没有先后三次的邑大开发者沙龙。感谢你多次给我平台并认可我。我在外头等你一年。 30 | 31 | 感谢雄爷,跟你探讨过无数次技术还有人生。你是我最早的支持者,给予我莫大鼓励。你热血、快言快语,最重要是够酷!我等你两年。 32 | 33 | 34 | 35 | 36 | 37 | 感谢陪伴了我四年的室友3dobe们,还记得当初的宿舍口号吗?那些挥之不去的想法,那些引以为傲的作品。我们曾在一个屋檐下奋斗过。感谢班上的同学们,你们的友爱,让我快乐成长;你们的猥琐,只会让我更懂生活。四年同窗,祝好。 38 | 39 | 40 | 41 | 42 | 43 | 感谢洪比,你是人生导师,伴我游走及启发我次数最多的人。玩世不恭的脸蛋与你那睿智深远的心境相矛盾。我向往你那不为现实所屈的性格。 44 | 45 | 最后,我要感谢昌爷。从当年我们的锐斧小组,到现在的深圳码农周末,你是那个陪我写过最多代码、打过最多次球、说过最多笑话、交换最多想法的人。一直以来,我们两人具有最大的反差,我避讳,你直白;我纠结,你果敢;我猴急,你迟缓;我强迫,你却又随性。但我们一路这么走来,还要继续走下去,也许这就是最好的拍档吧。 46 | 47 | 48 | -------------------------------------------------------------------------------- /p/2015/06/iPad_Photo_20141123095701SJ1K.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/06/iPad_Photo_20141123095701SJ1K.JPG -------------------------------------------------------------------------------- /p/2015/06/iPad_Photo_201506060404147EL8.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/06/iPad_Photo_201506060404147EL8.JPG -------------------------------------------------------------------------------- /p/2015/06/qsbk_dept_app.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/06/qsbk_dept_app.jpg -------------------------------------------------------------------------------- /p/2015/06/qsbk_office.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/06/qsbk_office.jpg -------------------------------------------------------------------------------- /p/2015/08/coding-style.md: -------------------------------------------------------------------------------- 1 | # 编码风格与人性 2 | 3 | *2015-08-09* 4 | 5 | 编程界的编码风格(Coding Style),指的是代码的书写风格或规范,如缩进是空格还是tab,加不加分号,变量命名等。 6 | 7 | ## 我的变化历程 8 | 9 | ### 分号 10 | 11 | 我基本在写JS,(多数情况下)分号可以省略,因此我不加,原因详见[这里](http://blog.fritx.me/?2015/01/why-no-semicolon)。但在两年前,我非加不可,出于强迫症,我还得帮别人加。 12 | 13 | ### 缩进 14 | 15 | 以前用tab,后来4空格,现在2空格。原因是,tab在一些地方显示成8空格,或者更变态,只有空格能够保持一致。2空格比4空格更紧凑,便于显示嵌套的代码。 16 | 17 | ### 变量命名 18 | 19 | 以前遵守JS原生命名习惯,类似JAVA的驼峰式,如`fullURL`,现在倾向于C/Python系的纯小写结合下划线,如`full_url`,并且非万不得已我不加下划线,即`fullurl`。原因是优雅,Python不是号称最优雅的语言吗?(当然还有方便,方便是我的第二个原则。) 20 | 21 | ## 遵守规范 22 | 23 | 一般来说,一个项目有一套相同的规范,甚至,一些团队推行自己专属的规范。这十分正常,为了保证代码的一致性和可靠性,也利于成员之间沟通。一般情况下,会有一个负责任的、具有强迫症的人来要求你加或不加分号。 24 | 25 | ## 借用工具 26 | 27 | ### 规范检查 28 | 29 | 市面上不缺少这些辅助工具。[jshint](https://github.com/jshint/jshint)等能够帮你量化和定义一套规范,验证编码风格,顺带检查语法错误等,你可以在提交代码前运行它。当然,这些最好集成进你的项目构建工具(Build System)当中。 30 | 31 | ### 规范转换 32 | 33 | 市面上有一堆代码转换(或编译)工具,如coffee、babel等,应该不缺处理编码风格的。我知道[semi](https://github.com/yyx990803/semi)可以用来转换加或不加分号,关于缩进和变量命名,如果你知道有哪些工具请顺带告诉我,谢了! 34 | 35 | ## 人性 36 | 37 | 编码风格是个喜好问题,并没有对错。只要不是错的,就都是对的。每个程序员都有自己的想法,我们应该尊重他们。 38 | 39 | 所以请不要再要求别人和你一样了,别人不是你,你也不是别人。 40 | 41 | 强迫症是对的,我也有。如果你拿强迫症来让自己和别人受罪,那么你就太SB了。 42 | 43 | 如果你有个开源项目,出现了几个很有建设性的PR,难道你会因为编码风格的差异,而选择不合并吗?你不能够先合并,然后再定期地通过工具来统一吗?两者兼得。 44 | 45 | 这就引出了我的一个设想。即在项目中,允许多方输入可用但风格不一致的代码,项目会定期借用工具自行修整。这会带来如下优势: 46 | 47 | - 及时高效地合并可用代码,不纠结 48 | - 减少手动修整代码带来的无效提交(Commit),不干扰代码追踪 49 | - 通过工具定期修整,带来完整性、配置性、自动化上的优势 50 | - 程序员专注输出可用代码,无需关心编码风格 51 | - 对程序员友好,尊重个性,弘扬人性 52 | -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/Music.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/Music.jpg -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/army.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/army.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/fanyi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/fanyi.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/friends.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/galaxy_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/galaxy_02.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/gulp-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/gulp-app.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/gulpeol.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/gulpeol.jpg -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/icon1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/icon1_2.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/markppt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/markppt.jpg -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/markppt_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/markppt_02.jpg -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/monkey.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/monkey.jpg -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/news.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/nodejs1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/nodejs1.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/npm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/npm.jpg -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/pm2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/pm2.jpg -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/qqlog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/qqlog.png -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/threejs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/threejs.jpg -------------------------------------------------------------------------------- /p/2015/08/nodejs-talk/ufo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2015/08/nodejs-talk/ufo.jpg -------------------------------------------------------------------------------- /p/2016/01/new-year-2016.md: -------------------------------------------------------------------------------- 1 | # 2016 写在年初 2 | 3 | *2016-01-03* 4 | 5 | 为何要写这篇文章?为了纪念过去一年所发生的一切,以及迎接新的一年。 6 | 7 | 2015之于我,是神奇的一年。四年的校园时光瞬间消逝,我已戴上工牌走向职场。 8 | 9 | 10 | ## 荒凉的宿舍楼 11 | 12 | 五月初,我从糗百回到学校,大四的几乎都走光了,整座宿舍楼成了蛮荒之地,我靠着仕灿、洪逼、雄爷的陪伴,度过了这段艰难的野人时期。也是在这种环境下,我完成了毕业设计,补够了挂科的学分,顺利毕业,最终告别了这里。 13 | 14 | 15 | ## 深圳码农周末 16 | 17 | 毕业了,回深圳,发现留下来的只有我、昌爷和晶哥了。一年前的码农周末,剑剑、英爷、锋哥都跑路了。想当年,我们意气风发,咖啡厅、山顶上,我们畅想无数……如今,难有这种机会了。 18 | 19 | 20 | ## 高产 21 | 22 | 进入D厂后,由于庞大而复杂的跨平台应用,我开始提出各种issue,fork一些依赖库,或是创作一些小东西。那是我在github上又一段高产时期。 23 | 24 | 25 | ## 忙 26 | 27 | 平时浏览器里都是这样子的: 28 | 29 | 30 | 31 | 因为项目重构,一口气引入了多种新技术,文档查个不停。学了很多,也做了很多,但忙到没时间写笔记、开新坑。组长、伙伴们还有主管都很给力,大家最终还是一起拥抱了未来。 32 | 33 | 34 | ## Don't Limit Yourself 35 | 36 | 这是英爷、雄爷的态度,也是码农周末帮小伙伴的态度。“不给自己设限”,我相信你们,未来是你们的。你们有伟大的梦想、骇人的行动力,以及对技术的敬畏。我愿意向你们学习,带我飞! 37 | 38 | -------------------------------------------------------------------------------- /p/2016/01/nwjs-code-protection/flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/2016/01/nwjs-code-protection/flow.png -------------------------------------------------------------------------------- /p/2016/01/nwjs-code-protection/index.md: -------------------------------------------------------------------------------- 1 | 2 | # nw.js代码保护术 3 | 4 | *2016-01-17* 5 | 6 | 7 | 8 | 9 | 10 | ## JS安全 11 | 12 | 伴随着node.js、nw.js、cordova、react-native等技术的发展,JS的适用范围增大,前端、后端、移动端、桌面端,商业性运用也在扩大。 13 | 14 | JS代码保护这一瓶颈将逐渐显露,“JS安全”将成为下一代火爆的话题。 15 | 16 | 17 | ## 研究背景 18 | 19 | > 兵来将挡,水来土掩。 20 | 21 | 我们IT部基于nw开发桌面应用,供公司内部使用。然而,某些部门竟然“勾结”,硬是看代码找茬,还拿了奖金。 22 | 23 | 24 | 25 | 不就是看不惯我们用node.js吗?嘿嘿嘿。 26 | 27 | 既然如此,我们只好开脑洞,想办法保护代码了。 28 | 29 | 30 | ## nw应用的基本文件结构 31 | 32 | ```plain 33 | - nwapp 34 | - dist/ 35 | - bundle.js 36 | - index.html 37 | - package.json 38 | ``` 39 | 40 | nw启动时,解析package.json,访问页面index.html,继而加载bundle.js。 41 | 42 | 我这里以打包bundle为例,即一个html页面对应仅有一个入口js文件。 43 | 44 | 如果你的项目不是,也没关系,方法类似。 45 | 46 | 47 | ## 那么,如何保护代码呢? 48 | 49 | 以下是一些手段罗列: 50 | 51 | - uglify 常规压缩 52 | - gulp-obfuscate这类 肉眼混淆 53 | - eval混淆 (可逆) 54 | - jsfuck (可逆, 膨胀厉害) 55 | - bundle打包 混淆效果增强 56 | - fs-auth这类 通过key加/解密 (有key则可逆) 57 | - v8.snapshot 代码快照/加载 (在nw中可使用) 58 | 59 | 其中eval、jsfuck暂时用不上;而gulp-obfuscate所产生的特殊字符,我们项目中的nw0.12.3又尚不兼容。 60 | 61 | 62 | 63 | 64 | 65 | 如上图所示,我们在发版构建过程完成以下任务即可: 66 | 67 | 1. 将code.js加密为code.fk 68 | 69 | ```js 70 | // tool/pack.js 71 | buf = read('code.js') 72 | buf = enc(buf, key) // 根据key加密 73 | write('code.fk', buf) 74 | ``` 75 | 76 | 2. 将用于调取code.fk的load.js快照为load.bin 77 | 78 | ```js 79 | // src/load.js 80 | buf = read('code.fk') 81 | buf = dec(buf, key) // 根据key解密 82 | script.innerHTML = buf.toString() // 运行 83 | ``` 84 | 85 | ```plain 86 | $ nwjc src/load.js dist/load.bin 87 | ``` 88 | 89 | 3. 最后保证index.html调取load.bin 90 | 91 | ```html 92 | 93 | 96 | ``` 97 | 98 | 这里我直接偷懒,把dev/prod各自用到的写在一起了,一份html两种环境都能跑。 99 | 100 | 这样就保证了业务逻辑code.js,以及调取逻辑load.js都被加密了,攻击者无法获得看明文代码。 101 | 102 | 103 | ## 打开控制台? 104 | 105 | > 想搞我?弄死你! 106 | 107 | package.json中window.toolbar字段关乎console可否被打开;再者,攻击者也可以篡改(唯一暴露的)index.html,加入打开console的命令。 108 | 109 | 咋整? 110 | 111 | 这时候key就派上用场了,key不是死的字符串,而应该是一个算法。 112 | 113 | 我们将key设定为依赖某些即时环境因素,如package.json及index.html的md5值。 114 | 115 | ```js 116 | key = [ 117 | md5(read('package.json')), 118 | md5(read('index.html')), 119 | ].join('') 120 | ``` 121 | 122 | 这样,他们就动不了这两个文件了,否则直接跑不起来。 123 | 124 | 另外,如果更加保险,也可以尝试重写/反重写方法,或判断console打开然后“下手”,以牙还牙。 125 | 126 | 127 | 128 | 129 | ## script标签 v.s. require() 130 | 131 | 这里以``的方式 47 | nw中一切正常 迁移到electron会报错`jQuery is not defined` 其他库如Zepto却正常 48 | 49 | 比对jquery和zepto源码后发现 zepto(不是zepto-node)默认浏览器环境 而jquery针对CommonJS等环境判断 选择合适的exports方式 [src/intro.js#L17](https://github.com/jquery/jquery/blob/master/src/intro.js#L17) 这个逻辑甚至比其他库还复杂 50 | 而简单的`module.exports`判断 导致对electron:script标签的(不完全)误判 将浏览器判为CommonJS 这种模式一时半会儿也改不了 51 | 在electron提出疑问[#2659](https://github.com/atom/electron/issues/2659) 也表示将不作变更 52 | 53 | 解决方案 对于此类环境误判的前端库 [webview:preload](https://github.com/atom/electron/issues/2048)不实用 改写为`require()`调用 或是 将源码定制一下吧 加段`window.$ = window.jQuery = module.exports` 54 | -------------------------------------------------------------------------------- /p/weekly/150911.md: -------------------------------------------------------------------------------- 1 | # 亮爷Weekly 0911 2 | 3 | > 再度延期 内容一般 也许真是江郎才尽了 4 | 5 | --- 6 | 7 | __[0911] 服务端phantomjs渲染 提取网页元信息__ 8 | [wet](https://github.com/fritx/wet)提取网页元信息 标题/描述/图片等 用于微信/qq分享类似效果 9 | 起初使用的是基本的request加html解析 但无法覆盖页面ajax等行为 因此v0.1.0起 决定引入[phantomjs](https://github.com/ariya/phantomjs)作服务端页面渲染 10 | 11 | phantom高层的封装有 nightmare, nightwatch, casperjs等 12 | 底层的bridge则有 phantomjs-node, node-phantom, node-phantom-simple等 13 | wet选择了[node-phantom-simple](https://github.com/baudehlo/node-phantom-simple) 14 | 15 | [lib/server](https://github.com/fritx/wet/blob/master/lib/server.js)中确保browser启动可用 提供api加载页面 额外等待5s以供渲染 16 | [lib/fetch](https://github.com/fritx/wet/blob/master/lib/fetch.js)调用server 同样是cheerio解析页面html 用算法提取元信息 17 | 该算法目前十分简单粗暴 我和同事将参考其他或自行完善 18 | 19 | --- 20 | 21 | __[0909] 使用qqface 替换qq经典表情/文字__ 22 | [qqlog](https://github.com/fritx/qqlog)一直没能替换qq表情为文字 也就是[wqq](https://github.com/fritx/wqq)待完善中提到的 表情语义化 23 | 24 | 今日综合分析[Dualx源码](https://github.com/Donkil/Dualx/blob/master/scripts%2Fchat.js) 及[smartqq压缩的代码](http://pub.idqqimg.com/smartqq/js/mq.js) 解密了qq表情码与文字的映射关系 25 | 特此抽离 发布新模块[qqface](https://github.com/fritx/qqface) 作依赖引入qqlog 实现了表情语义 26 | 27 | ```js 28 | qqface.textFromCode(14) 29 | //=> '微笑' 30 | qqface.textFromCode(14, 'en') // 英文可选 31 | //=> 'Smile' 32 | ``` 33 | 34 | 名词解释: 35 | - `text`为表情对应的文字信息 36 | - `code`为表情对应的数字码 37 | - `index`为表情选择栏上的显示序号 38 | 39 | --- 40 | 41 | __[0906] 使用node-screencapture 实现跨平台桌面截屏__ 42 | 公司im项目需要做类似qq的截图功能 因此调用截屏是基础 43 | mac就一句命令`screencapture` win却无相应命令行 44 | [screencap](https://github.com/active9/screencap#installing)在win上要求安装的东西太多了 pass 45 | 46 | 因为缺乏认知 对使用c++编写node插件望而却步 47 | 考虑过底层的robotjs 直接调用`PrtScr`按键 但目前缺乏支持 已询问[robotjs#83](https://github.com/octalmage/robotjs/issues/83) 48 | 今日发现了个[nircmd](http://www.nirsoft.net/utils/nircmd.html) win上命令行截屏 相当高尚号称freeware 49 | 而且exe仅43K (x64版是111K 但貌似前者足矣) 50 | 51 | 自此 可以产生一个node调用库了本想自己造轮子 但还是决定讲点素质 52 | 搜到[node-screencapture](https://github.com/uiureo/node-screencapture) 刚好缺少win支持 于是[自行fork加入](https://github.com/fritx/node-screencapture/commit/7bb4fe1893ddb5581bda5e2b447c3bcc3ff80c5e) 顺便PR 53 | 54 | ```js 55 | // 可以直接依赖我的fork分支 跨平台桌面截屏 56 | dependencies: { 57 | "screencapture": "git://github.com/fritx/node-screencapture#win32" 58 | } 59 | ``` 60 | -------------------------------------------------------------------------------- /p/weekly/151016.md: -------------------------------------------------------------------------------- 1 | # 亮爷Weekly 1009+1016 2 | 3 | > 两期合并 马马虎虎 4 | 5 | --- 6 | 7 | [1016] nw弹窗 show/hide 去动画 位置hack 8 | 因为windows使用了enterFullScreen() 无法应用于多屏幕 9 | 将其去掉后 可以resize 需要补充setResizable(false) 10 | 并且show/hide自带的动画就出现了 加timeout也还是要显示 11 | 12 | 自己hack了一下 就是show/hide前 先moveTo(-32000, -32000) 然后show 13 | timeout 200ms左右 再moveTo(0, 0) 即可实现无动画show hide反之 14 | -32000出自一次修复窗口抖动 发现窗口弹出动画期间 x,y=-32000,-32000 15 | 16 | ```js 17 | guiwin.moveTo(-32000, -32000) // 位置hack 18 | guiwin.resizeTo(fullWidth, fullHeight) 19 | guiwin.setResizable(false) // 取消enterfullscreen后需补上 20 | guiwin.show() 21 | // ... 22 | setTimeout(function(){ 23 | guiwin.moveTo(0, 0) 24 | guiwin.focus() 25 | }, 200) 26 | ``` 27 | 28 | --- 29 | 30 | [1016] nw截图 添加了 多屏幕支持 31 | 参考了wiki https://github.com/nwjs/nw.js/wiki/Screen 32 | fullWidth/fullHeight 算法有些弱智 假设多个屏幕是横着拼接 有待观察 33 | 34 | ```js 35 | gui.Screen.Init() 36 | var screens = gui.Screen.screens 37 | var fullWidth = screens.reduce(function(m, scr){ 38 | return m + scr.bounds.width 39 | }, 0) 40 | var hs = screens.map(function(scr){ 41 | return scr.bounds.height 42 | }) 43 | var fullHeight = Math.max.apply(null, hs) 44 | 45 | guiwin.moveTo(0, 0) 46 | // guiwin.resizeTo(window.screen.width, window.screen.height) 47 | guiwin.resizeTo(fullWidth, fullHeight) 48 | ``` 49 | 50 | --- 51 | 52 | [1015] 今天会上 提到 SSO单点登录 和 验证码实现 53 | 我在最后也抛砖引玉 公司是否愿意采纳 Passwordless登录 54 | 项目 https://github.com/florianheinemann/passwordless 55 | 文章 https://medium.com/@ninjudd/passwords-are-obsolete-9ed56d483eb 56 | 我一连补充了几次 引发积极讨论 新想法也得到组长肯定 57 | 58 | 1. 省掉了注册和设定密码环节 59 | 2. 初衷是 认为密码反人类 要干掉密码 60 | 3. 无需自维护一套密码表 安全性得到转嫁和解放 61 | 62 | --- 63 | 64 | [1013] 同事irina的osx 10.10.5 出现了奇葩现象 命令行下 screencapture killed 9 65 | 影响node-screencapture调用 从而影响GT截图 66 | 经试验 发现将其/usr/sbin/screencapture copy到用户目录下 67 | 改名为"sc"甚至"screencapture1" 都可运行成功 68 | 说明文件名(或进城名)“screencapture”就会被杀 并且与用户权限无关 69 | 我把这个fix 也提交到 [fritx/node-screencapture#gt](https://github.com/fritx/node-screencapture/tree/gt)上 70 | 71 | ~~真是 no zuo no die 啊!早知不发issue了~~ 还被发现版权问题 72 | 但最后 老夫真是太机智了 [uiureo/node-screencapture#5](https://github.com/uiureo/node-screencapture/issues/5) 73 | 74 | --- 75 | 76 | [1006] nightmare yield之谜 77 | - test yield 并未传done https://github.com/segmentio/nightmare/blob/master/test%2Findex.js#L52 78 | - actions.js 并未特别判断done https://github.com/segmentio/nightmare/blob/master/lib%2Factions.js#L56-L61 79 | - nightmare.js 方法二度重写 但并this不是promise https://github.com/segmentio/nightmare/blob/master/lib%2Fnightmare.js#L258-L266 80 | - 原来是then co判断promise https://github.com/tj/co/blob/master/index.js#L197-L199 81 | 82 | --- 83 | 84 | [1002] linux下 electron-prebuilt全局安装失败 85 | 86 | ```plain 87 | npm ERR! electron-prebuilt@0.33.4 postinstall: `node install.js` 88 | npm ERR! Exit status 127 89 | npm ERR! code ELIFECYCLE 90 | ``` 91 | 92 | [mafintosh/electron-prebuilt#27 (comment)](https://github.com/mafintosh/electron-prebuilt/issues/27#issuecomment-105617789) 93 | -------------------------------------------------------------------------------- /p/weekly/160227.md: -------------------------------------------------------------------------------- 1 | # 亮爷Weekly 0227 2 | 3 | > 过完年 终于又开始出产了 4 | 5 | --- 6 | 7 | [0227] 不知会不会被叼 但觉得自己帅呆了 8 | 9 | [segmentio/nightmare: Issue #511](https://github.com/segmentio/nightmare/issues/511) 10 | [segmentio/nightmare: Issue #513](https://github.com/segmentio/nightmare/issues/513) 11 | 12 | 连发两个相互关联的issue&PR 豪言壮语 13 | 原始出处: [fritx/nixe: 8b07402](https://github.com/fritx/nixe/commit/8b074022c52c0e74e0dd5748c1c4e73778e6e0a6) 14 | 15 | --- 16 | 17 | [0225] mocha测试 断言async函数的误区 18 | How to test an ES7 async function [chaijs/chai: Issue #415](https://github.com/chaijs/chai/issues/415) 19 | nixe提交 [fritx/nixe: fcd98bb](https://github.com/fritx/nixe/commit/fcd98bb8d0859a37454d98dda646f424f3112c82#diff-366a9017f9dba12fc4c2bab2c4a1342eR9) 20 | 21 | > async函数返回的是Promise 断言时不应判断throw 而应判断reject 22 | 23 | ```js 24 | it('electron-prebuilt should be installed', async () => { 25 | await access('node_modules/electron-prebuilt') 26 | }) 27 | 28 | it('no `electron` should be installed', async () => { 29 | // access('node_modules/electron').should.throw() // wrong 30 | access('node_modules/electron').should.be.rejected() 31 | }) 32 | ``` 33 | 34 | --- 35 | 36 | [0222] yaml特殊字符转义初试探 37 | 38 | http://stackoverflow.com/questions/3790454/in-yaml-how-do-i-break-a-string-over-multiple-lines 39 | 40 | ```yml 41 | # i18n/map.yml 42 | 字体选择: 43 | en: "Font" 44 | 选择表情: 45 | en: "Emoticon" 46 | 向好友发送窗口抖动: 47 | en: "Nudge" 48 | ? 49 | >- 50 | %s给您发送了一个窗口抖动 51 | : 52 | en: "%s has sent a nudge to you." 53 | 您发送了一个窗口抖动: 54 | en: "You have sent a nudge." 55 | ``` 56 | 57 | --- 58 | 59 | [0218] SublimeText3-3083升级到3103后 60 | JS语法高亮有些变爽了 有些却遭到破坏 (尤其是React 61 | 62 | https://github.com/jamiewilson/predawn/issues/122 63 | https://forum.sublimetext.com/t/javascript-syntax-highlighting-changes-in-3103/17328/18 64 | 65 | 未找到科学的办法 唯有下载3083降级覆盖 将下载链接中3103替换为3083即可 66 | 67 | --- 68 | 69 | [0201] 保证文件名在os合法 (pc收到mac发的文件) 70 | 71 | http://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names 72 | 73 | ```js 74 | const savename = filename.replace(/[\\\/:\*\,"\?<>|]/g, '_') 75 | ``` 76 | 77 | --- 78 | 79 | [0128] 编辑器 消息发送前 图片上传服务器 匹配逻辑 80 | 81 | - http:// 协议补全 82 | - 本地路径识别 (file:// | Win | Unix) 83 | 84 | ```js 85 | for (var i = 0; i < items.length; i++) { 86 | if (items[i].type === 'image') { 87 | // 以//开头 省略协议的地址 补全http协议 否则nw会转file协议 88 | items[i].src = items[i].src.replace(/^\/\//, 'http://') 89 | // 匹配 file://开头 或者PC/Mac的绝对路径 90 | if (/^file:\/\/|^\w:|^\/[^\/]/.test(items[i].src)) { 91 | localPicsIndex.push(i) 92 | } 93 | } 94 | } 95 | ``` 96 | -------------------------------------------------------------------------------- /p/weekly/160312.md: -------------------------------------------------------------------------------- 1 | # 亮爷Weekly 0312 2 | 3 | > 隔了一周 内容好少 555 4 | 5 | --- 6 | 7 | [0312] electron报错 同名node_module依赖坑 8 | 如果`electron xxx`启动客户端 发现错误electron报错: 9 | 10 | ```plain 11 | Uncaught TypeError: Cannot read property 'on' of undefined` 12 | ``` 13 | 14 | 可以尝试执行如下修复: 15 | 16 | ```plain 17 | $ npm uninstall -S electron 18 | ``` 19 | 20 | 是npm-install-webpack-plugin导致的坑 已移除该依赖 21 | 该坑不是第一次遇到 参见[fritx/nixe:test/electron.js](https://github.com/fritx/nixe/blob/dev/test/electron.js) 22 | 23 | --- 24 | 25 | [0310] terminal隐藏/修改前缀显示 26 | http://apple.stackexchange.com/questions/34910/how-to-hide-computer-name-and-user-name-in-terminal-command-prompt 27 | 28 | ```plain 29 | $ echo "export PS1='\W\$ '" >> ~/.bash_profile 30 | $ . ~/.bash_profile 31 | ``` 32 | 33 | --- 34 | 35 | [0308] 漫长的努力 不离不弃 最终似乎解决了 36 | 一个半月后的我 早已不那么关心结果了 37 | 但我仔细想想 是否应该对项目/对作者/对这种精神/对曾经的自己 多一点点尊重呢 38 | 这个项目还是有点6 39 | [ericclemmons/npm-install-webpack-plugin: Pull Request 17](https://github.com/ericclemmons/npm-install-webpack-plugin/pull/17#issuecomment-180398402) 40 | 41 | --- 42 | 43 | [0307] Why prompt is not supported? 好像很有学问的样子 44 | [atom/electron: Issue #472](https://github.com/atom/electron/issues/472) 45 | nightmare/nixe对prompt的处理 有待研究 46 | webui solutions: [vux](https://github.com/HubSpot/vex), [smalltalk](https://github.com/coderaiser/smalltalk) 47 | [atom/electron: Issue #749](https://github.com/atom/electron/issues/749) 卧槽 逛着逛着发现了自己 也是醉了 48 | 49 | --- 50 | 51 | [0304] 更正url正则匹配 52 | [weekly#151002](http://blog.fritx.me/?weekly/151002) 53 | 该正则属原创 规则以微信为主要参照 较适合一般IM使用 54 | 希望日后添加足够量的测试用例 55 | 56 | ```js 57 | var r = /((https?|ftp):\/\/((\w|-)+\.)*((\w|-)+|(-)+)|((https?|ftp):\/\/)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|((https?|ftp):\/\/)?((\w|-)+\.)+(asia|cn|hk|tw|us|uk|ca|jp|com|net|org|cc|co|so|info|me|name|website|site|space|host|top|biz|mobi|tv|tm|tel|tech)(\.((\w|-)+|(-)+))*)(:\d+)?[\/\\\?%-_\w]*/gi 58 | ``` 59 | -------------------------------------------------------------------------------- /p/weekly/170127/newyear.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritx/blog/fb20c9c12826cb1a9a9e5400b797ff374af0d5ec/p/weekly/170127/newyear.jpg -------------------------------------------------------------------------------- /vendor/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | .hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | background: #3f3f3f; 13 | color: #dcdcdc; 14 | } 15 | 16 | .hljs-keyword, 17 | .hljs-selector-tag, 18 | .hljs-tag { 19 | color: #e3ceab; 20 | } 21 | 22 | .hljs-template-tag { 23 | color: #dcdcdc; 24 | } 25 | 26 | .hljs-number { 27 | color: #8cd0d3; 28 | } 29 | 30 | .hljs-variable, 31 | .hljs-template-variable, 32 | .hljs-attribute { 33 | color: #efdcbc; 34 | } 35 | 36 | .hljs-literal { 37 | color: #efefaf; 38 | } 39 | 40 | .hljs-subst { 41 | color: #8f8f8f; 42 | } 43 | 44 | .hljs-title, 45 | .hljs-name, 46 | .hljs-selector-id, 47 | .hljs-selector-class, 48 | .hljs-section, 49 | .hljs-type { 50 | color: #efef8f; 51 | } 52 | 53 | .hljs-symbol, 54 | .hljs-bullet, 55 | .hljs-link { 56 | color: #dca3a3; 57 | } 58 | 59 | .hljs-deletion, 60 | .hljs-string, 61 | .hljs-built_in, 62 | .hljs-builtin-name { 63 | color: #cc9393; 64 | } 65 | 66 | .hljs-addition, 67 | .hljs-comment, 68 | .hljs-quote, 69 | .hljs-meta { 70 | color: #7f9f7f; 71 | } 72 | 73 | 74 | .hljs-emphasis { 75 | font-style: italic; 76 | } 77 | 78 | .hljs-strong { 79 | font-weight: bold; 80 | } 81 | --------------------------------------------------------------------------------