Skip to content

Instantly share code, notes, and snippets.

View prinsss's full-sized avatar
🐟
摸鱼中

prin prinsss

🐟
摸鱼中
View GitHub Profile
@prinsss
prinsss / printempw.pub
Last active January 16, 2020 15:28
我的 PGP 公钥:B51137BF34A36F0652241A816FC03E5D3F409A40
-----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
@prinsss
prinsss / concat.sh
Last active December 14, 2020 15:14
使用 ffmpeg 拼接 Bilibili 客户端所下载的分段 flv 视频,https://blessing.studio/use-ffmpeg-to-concat-flv-videos-downloaded-by-bilibili-client/
# @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;
@prinsss
prinsss / ebook.css
Created May 8, 2017 14:04
适配 Kindle 的电子书样式
/* 忘记从哪本书里扒出来的了,待优化,仅做备份 */
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;}
/*书名页*/
@prinsss
prinsss / nginx.conf
Created February 25, 2017 10:14
Nginx rewrite configuration for PHP MVC frameworks.
location / {
try_files $uri $uri/ /index.php?$query_string;
}
@prinsss
prinsss / example.js
Created February 9, 2017 16:09
Originally created by @osvaldasvalutis, callback support by @printempw.
$.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()
}];
}
});
@prinsss
prinsss / sum.php
Created January 10, 2017 15:11
Calculate the total number of comments posted last year from Diqus exported XML file.
<?php
/**
* @Author: printempw
* @Date: 2017-01-10 22:44:20
* @Last Modified by: printempw
* @Last Modified time: 2017-01-10 23:09:35
*/
$xmlString = file_get_contents('./blessing-studio-2017-01-10T14_38_39.483395-all.xml');
@prinsss
prinsss / 1-nginx-vhost-template.conf
Created January 7, 2017 14:00
Template for creating new nginx vhost.
server {
listen 443 ssl http2;
server_name your-domain.com www.your-domain.com;
index index.html index.htm index.php;
# Let's Encrypt Certificate
ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@prinsss
prinsss / nginx.conf
Created December 25, 2016 06:21
Chereveto rewrite rules for Nginx
location / {
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
@prinsss
prinsss / page.html
Created December 17, 2016 09:58
Click button to load Disqus
<a class="btn btn-default" href="javascript:disqus.load();">点击以加载 Disqus</a>
@prinsss
prinsss / index.html
Created November 26, 2016 10:07
PHP Remote Download with Progress Bar [Frontend]
<p>更新包大小:<span id="file-size">0</span> Bytes</p>
<!-- 进度条 -->
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
<span id="imported-progress">0</span>%
</div>
</div>
<script>
// 更新进度条的函数