Skip to content

Instantly share code, notes, and snippets.

@goooooouwa
goooooouwa / CardDiaryTXT.txt
Last active Jan 14, 2020
break CardDiary export txt file into individual diary txt files with date as title. So that I can import these text files into Evernote.
View CardDiaryTXT.txt
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
@goooooouwa
goooooouwa / Subscriptions.opml
Created Jan 14, 2020
extract rss feed urls from opml file
View Subscriptions.opml
<?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"/>
View 2018-09-18-How to convert outline text to mindmap.md
title layout category tags
How to convert outline text to mindmap
post
productivity
outline, freemind, mindmap

Requirements:

View 2018-09-25-Git-Tips-Tricks.md
title layout category
Git Tips & Tricks
post
coding

{{TOC}}

Find and restore a deleted file in a Git repo

View 2017-07-13-JS prototype-based OO key steps.md
title layout category tags
JS prototype-based OO key steps
post
coding
javascript
// 1. define the Person Class
function Person() {
View send-markdown-to-evernote.sh
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
View import-card-diary-to-jekyll.js
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'}`;
View remove_firstline.sh
#!/bin/bash
# remove the line immediately after front matter
for filename in $TEMP/*; do
echo $filename
sed '8d' $filename > tmpfile; mv tmpfile $filename
done
View useful-linux-commands.sh
# How to strip out all of the links of an HTML file in Bash or grep or batch and store them in a text file
# https://stackoverflow.com/questions/21264626/how-to-strip-out-all-of-the-links-of-an-html-file-in-bash-or-grep-or-batch-and-s
sed -n 's/.*href="\([^"]*\).*/\1/p' file
View cocos-2dx-animation-pause-until-async-action-complete.js
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");
});
You can’t perform that action at this time.