Skip to content

Instantly share code, notes, and snippets.

🐟
摸鱼中

PRIN. printempw

🐟
摸鱼中
Block or report user

Report or block printempw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@printempw
printempw / check_youtube.py
Created Jul 4, 2019
Check whether YouTube channel is live streaming.
View check_youtube.py
#!/usr/bin/env python3
# coding: utf-8
import re
import sys
import json
import requests
from retrying import retry
headers = {
@printempw
printempw / bash.zsh-theme
Last active Jun 18, 2019
My custom oh-my-zsh themes.
View bash.zsh-theme
# Just a copy of the default prompt of bash.
# root@youtube-relay-station:/home/wwwroot$
PROMPT='%{$fg[green]%}%n@%m%{$reset_color%}:%{$fg[cyan]%}%~%{$reset_color%}$ '
@printempw
printempw / .travis.yml
Last active Nov 8, 2018
Travis CI config for Hexo blog automatic deployment.
View .travis.yml
language: node_js
node_js: stable
# 只监听 source 分支的改动
branches:
only:
- source
# 缓存依赖,节省持续集成时间
cache:
@printempw
printempw / example.js
Created Jun 25, 2017
Hexo 访问计数器,前端示例脚本。
View example.js
/**
* 这里处理一下 slug,去掉多余字符。
* Hexo 博客中的页面(即 layout 为 page)的 `page.path` 会带上一个 `index.html`,搞不懂为什么。
*/
String.prototype.cleanSlug = function () {
var search = '/index.html';
if (this.indexOf(search) === -1) {
return this.slice(0, -1)
} else {
@printempw
printempw / lib.js
Created Jun 11, 2017
依赖于 jQuery 的纯前端生成文章目录(Table of Contents)。本来是为了辣鸡 Ghost 博客写的,可惜我现在要投奔 Hexo 了 ( ̄3 ̄)
View lib.js
/**
* 差不多就是把一些项目中的现有代码黏在一起,能用而已。目前实现的功能有:
*
* - 生成 TOC(废话)
* - 滚动监听(高亮当前项目)
* - 点击跳转
*/
// https://github.com/ghiculescu/jekyll-table-of-contents
(function($){
@printempw
printempw / 621sama.pub
Last active May 20, 2017
我的 PGP 公钥:B51137BF34A36F0652241A816FC03E5D3F409A40
View 621sama.pub
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFkgK7UBCADiDZCI37cTPEGW9hHP0AcsVItwozCjjd2bGdNoxOdINiQKHuaX
ILDipjwM1MgaLDculcbzH/LekviL8IKqwJbqWsNJfG6OW2WPUvn+UbCOdBzp2+Be
QO4vNFEaZGINeZ5cQuXU/+Z8kV0TauIqc3ngGxF4F/Kp1PNLtX8j5+LoV68pcTUt
ojmHXDc2gfFtH/bxAcZtpXyU2KgKGJab6ojOc/EE72qUe/+T/fiEhqQ+vUPdUgMe
Zl3CCi2+h9pe75lm2mlNi+jQjG/mS499bCgfFfZUAICniO0KKja++Wox4v/uDCyz
B/FRg5uuZJaliaWD8EF6AS5IP0NLpXJkqkDnABEBAAG0JjYyMXNhbWEgKHByaW50
ZW1wdykgPGhAcHJpbnpldWdlbi5uZXQ+iQE2BBMBCgAgBQJZICu1AhsDBQsJCAcD
@printempw
printempw / concat.sh
Last active Nov 3, 2018
使用 ffmpeg 拼接 Bilibili 客户端所下载的分段 flv 视频,https://blessing.studio/use-ffmpeg-to-concat-flv-videos-downloaded-by-bilibili-client/
View concat.sh
# @Author: printempw
# @Date: 2017-05-13 17:54:48
# @Last Modified by: printempw
# @Last Modified time: 2017-05-13 21:37:41
cat /dev/null > ff.txt
# 防止变成 1、10、2、3 这样的顺序
for i in `ls -1 *.flv | sort -n`; do
echo "file '${i}'" >> ff.txt;
@printempw
printempw / ebook.css
Created May 8, 2017
适配 Kindle 的电子书样式
View ebook.css
/* 忘记从哪本书里扒出来的了,待优化,仅做备份 */
body {font-family:song;}
/*封面*/
.cover{height:100%;}
/*书名页*/
.smy-sm{font-size:2em;font-family:hei;margin-top:2em;margin-bottom:0em;text-align:center;font-weight:normal;}
/*书名页*/
@printempw
printempw / nginx.conf
Created Feb 25, 2017
Nginx rewrite configuration for PHP MVC frameworks.
View nginx.conf
location / {
try_files $uri $uri/ /index.php?$query_string;
}
@printempw
printempw / example.js
Created Feb 9, 2017
Originally created by @osvaldasvalutis, callback support by @printempw.
View example.js
$.disqusLoader('.disqus', {
scriptUrl: '//blessing-studio.disqus.com/embed.js',
laziness: 0,
preLoadCallback: function () { $('.disqus-notice').show() },
disqusConfig: function () {
this.callbacks.onReady = [function () {
$('.disqus-notice').hide()
}];
}
});
You can’t perform that action at this time.