This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in module1.js | |
| function a(){ | |
| console.log('hello'); | |
| } | |
| module.exports.a = a; | |
| // in module2.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // how to find all Person records | |
| // 如何查找所有人的记录 | |
| Person.find() // or Person.all() | |
| // how to find Person records with surname beginning with word "Gr" | |
| // 如何查找surname以“Gr"字母开头的人的记录 | |
| Person.find({ surname: orm.like("Gr" + "%") }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var anim = this.node.getChildByName("flashLight").getComponent(cc.Animation); | |
| // these 3 steps must in order to play and pause the animation at 0.5s | |
| anim.setCurrentTime(0.5, 'flashLight'); | |
| anim.play("flashLight"); | |
| anim.pause('flashLight'); | |
| this.render().then(() => { | |
| // these 2 steps must in order to resume the animation from 0.5s | |
| anim.setCurrentTime(0.5, 'flashLight'); | |
| anim.resume("flashLight"); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| const contents = fs.readFileSync('CardDiary-JSON.json', 'utf8'); | |
| const obj = JSON.parse(contents); | |
| for (const d of obj.diaryExports) { | |
| const diary = JSON.parse(d.content); | |
| const date = d.createDate.substring(0, 10); | |
| const filename = `${date}-${diary.title || 'log'}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for filename in ./_drafts/*.md; do | |
| echo $filename | |
| date=$(echo $filename | cut -c 11-20) | |
| title=$(echo $filename | cut -c 22- | rev | cut -c 4- | rev) | |
| geeknote create --title "$title" --created "$date" --content "$filename" | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <opml version="1.0"> | |
| <head> | |
| <title>Subscriptions - RSS</title> | |
| </head> | |
| <body> | |
| <outline htmlUrl="http://newworldinteractive.com" title="Blog – New World Interactive" xmlUrl="http://newworldinteractive.com/blog/feed/" type="rss" text="Blog – New World Interactive"/> | |
| <outline htmlUrl="http://www.steampowered.com/" title="New On Steam" xmlUrl="https://store.steampowered.com/feeds/newreleases.xml" type="rss" text="New On Steam"/> | |
| <outline htmlUrl="https://goooooouwa.github.io/" title="Shunfa’s Blog" xmlUrl="https://goooooouwa.github.io/feed.xml" type="rss" text="Shunfa’s Blog"/> | |
| <outline title="test" xmlUrl="tag/test" type="rss" text="test"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Date: 2018-09-25 16:29:58 | |
| Weather: Cloudy | |
| Demo diary post 1 | |
| Date: 2018-09-26 19:05:07 | |
| Weather: Mostly Cloudy Day | |
| Demo diary post 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo INFO: host: red hat 9.0 with all packages in installation CDs installed. | |
| echo INFO: target: armv4tl Linux 2.6.12-h1940 libc 2.3.2 | |
| echo INFO: all operations are executed under root | |
| #build mode | |
| INSTALL_CROSSTOOL="" | |
| COPY_LIBS="" | |
| COMPILE_QT="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # bash for loop | |
| for i in $(seq 10 $END); do | |
| echo $i | |
| done | |
| # 1.Iterate over collection | |
| for i in a b c; do | |
| echo $i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xargs -n 1 curl -O -L --retry 5 --retry-max-time 60 -C - < ./mp3-urls-unique-id-fix.txt |