Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Studying at freeCodeCamp

赤琦 redblue9771

👨‍💻
Studying at freeCodeCamp
View GitHub Profile
@redblue9771
redblue9771 / 📊 Weekly development breakdown
Last active Oct 29, 2020
📊 Weekly development breakdown
View 📊 Weekly development breakdown
TypeScript 3 hrs 34 mins ████████████▋░░░░░░░░ 60.3%
Other 1 hr 51 mins ██████▌░░░░░░░░░░░░░░ 31.3%
Markdown 7 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.0%
Python 7 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.0%
JSON 3 mins ▏░░░░░░░░░░░░░░░░░░░░ 1.1%
@redblue9771
redblue9771 / Conventional Commits.md
Last active Nov 17, 2020
约定式提交规范
View Conventional Commits.md

1. 全局安装commitizen & cz-conventional-changelog

commitizen是一个撰写合格commit message的工具,用于代替git commit指令,而 cz-conventional-changelog 适配器提供 conventional-changelog 标准(约定式提交标准)。

基于不同需求,也可以使用不同适配器。

npm install -g commitizen cz-conventional-changelog
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
@redblue9771
redblue9771 / note.txt
Last active Jan 31, 2020
deepin-wine-tim
View note.txt
pacman -S gnome-settings-daemon //添加到自启
gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'
### (5)TIM 需要的 Flash 的安装方法
1. 下载需要的 install_flash_player_ppapi.exe
2. 将下载的安装文件放入~/.deepinwine/Deepin-TIM/drive_c 下,即 TIM 所在 Wine C 盘根目录
3. 打开一个 Terminal ,执行:
View git-clear-cache.sh
git rm -r --cached .
git add .
git commit -am 'git cache cleared'
git push
@redblue9771
redblue9771 / index.css
Last active Dec 1, 2019
Awesome Timeline
View index.css
.main-timeline{
overflow: hidden;
position: relative;
padding: 60px 0;
}
.main-timeline:before{
content: "";
width: 1px;
height: 100%;
background: #cfcdcd;
View stylus.json
[
{
"installDate": 1534259003610,
"enabled": true,
"updateUrl": "https://userstyles.org/styles/chrome/130739.json",
"md5Url": "https://update.userstyles.org/130739.md5",
"url": "http://userstyles.org/styles/130739",
"originalMd5": "dc4cddc4ac86caaac18a24e2eaea4255",
"sections": [
{
@redblue9771
redblue9771 / returnTime.js
Created Jul 12, 2019
JavaScript 中一些时间功能的实现 - 给一个时间戳,返回距离现在多久了
View returnTime.js
/**
* 给一个时间戳,返回距离现在多久了
* @param time 一个时间戳
* @returns {*} 时间差
*/
function returnTime(time) {
if (isNaN(time) === true)
return "Error!" + '"' + time + '"' + " is NaN";
if (time < 0) return "Error! 过去的时间大于现在的时间!";
else {
@redblue9771
redblue9771 / countDown.js
Created Jul 12, 2019
JavaScript 中一些时间功能的实现 - 倒计时
View countDown.js
/**
* 倒计时
* @param now 现在的时间
* @param startTime 计时开始时间
* @param endTime 计时结束时间
* @returns {*} 计时标识
*/
function countDown(startTime, endTime) {
var now = Date.now();
if (now < startTime) {
@redblue9771
redblue9771 / checkTime.js
Created Jul 12, 2019
JavaScript 中一些时间功能的实现 - 检查平润年,返回正确月份的天数
View checkTime.js
/**
* 检查平润年,返回正确月份的天数
* @param year 年份
* @param month 月份
* @returns {number} 该月正确的天数
*/
function checkTime(year, month) {
if (month === 2) return (year % 4 === 0 && year % 100 !== 0 || year % 400) === 0 ? 29 : 28;
return '4;6;9;11'.indexOf(month + ';') === -1 ? 31 : 30;
}
@redblue9771
redblue9771 / formatTime.js
Created Jul 12, 2019
JavaScript中一些时间功能的实现 - 格式化时间戳(yy/mm/dd hh:MM)
View formatTime.js
/**
* 格式化时间戳 格式:yy/mm/dd hh:MM
* @param time 时间戳
* @returns {string} yy/mm/dd hh:MM
*/
function formatTime(time) {
var date = new Date(time);
var year = date.getFullYear();
var month = date.getMonth() + 1;
var days = date.getDate();