Skip to content

Instantly share code, notes, and snippets.

View coronin's full-sized avatar
💭
Find me @the_paper_link

Liang Cai coronin

💭
Find me @the_paper_link
View GitHub Profile
@Kxrr
Kxrr / webdev_jianguoyun.py
Last active January 18, 2022 08:40
Webdev example for Jianguoyun
# -*- coding: utf-8 -*-
"""
* 关于坚果云的 Webdav 的配置可以参看: https://griddiary.uservoice.com/knowledgebase/articles/478287-%E5%9D%9A%E6%9E%9C%E4%BA%91-webdav-%E8%AE%BE%E7%BD%AE%E6%95%99%E7%A8%8B
* 使用前请先安装 `easywebdav` : ``pip install easywebdav``
坚果云 Webdav
============
假设有下面的坚果云目录结构
@heyalexej
heyalexej / pytz-time-zones.py
Created November 16, 2016 09:14
list of pytz time zones
>>> import pytz
>>>
>>> for tz in pytz.all_timezones:
... print tz
...
...
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active May 7, 2024 14:54
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@littlecodersh
littlecodersh / WeChatCheckFriend.py
Created September 28, 2016 04:59
Demo of checking friends' status of wechat.
#coding=utf8
import itchat
CHATROOM_NAME = 'friend'
CHATROOM = None
HELP_MSG = u'''\
好友状态监测
* 发送名片将会返回好友状态
* 请确有名为%s的未使用的群聊
* 并将该群聊保存到通讯录
@littlecodersh
littlecodersh / WechatSmartWish.py
Created September 28, 2016 03:01
Demo of sending smart wishes through wechat.
#coding=utf8
import itchat, time
SINCERE_WISH = u'祝%s新年快乐!'
REAL_SINCERE_WISH = u'祝%s新年快乐!!'
def send_wishes():
friendList = itchat.get_friends(update=True)[1:]
for friend in friendList:
# 如果不是演示目的,把下面的方法改为itchat.send即可
@scottopell
scottopell / sh.sh
Created September 8, 2016 15:40
Embed SRT file into mp4 with ffmpeg
# got this from http://stackoverflow.com/questions/8672809/use-ffmpeg-to-add-text-subtitles
ffmpeg -i infile.mp4 -f srt -i infile.srt -c:v copy -c:a copy -c:s mov_text outfile.mp4
# confirmed working with the following ffmpeg
# (installed using `brew 'ffmpeg', args: ['with-libvorbis', 'with-libvpx']` )
ffmpeg version 3.1.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libvpx --disable-lzma --enable-vda
@littlecodersh
littlecodersh / main.py
Last active April 14, 2024 08:22
Main script behind itchat robot
#coding=utf8
import itchat
# tuling plugin can be get here:
# https://github.com/littlecodersh/EasierLife/tree/master/Plugins/Tuling
from tuling import get_response
@itchat.msg_register('Text')
def text_reply(msg):
if u'作者' in msg['Text'] or u'主人' in msg['Text']:
return u'你可以在这里了解他:https://github.com/littlecodersh'
@wanliang1221
wanliang1221 / nginx 反向代理 blog.conf
Created July 19, 2016 05:54 — forked from shellexy/nginx 反向代理 blog.conf
在 vps 用 nginx 反向代理 wordpress/blogger
# /etc/nginx/sites-available/blog.shellexy.info
server {
resolver 8.8.8.8;
listen 80;
server_name blog.shellexy.info;
#access_log off;
access_log /var/log/nginx/blog.shellexy.info.access.log;
location / {
#避免远方启用压缩导致无法替换纯文本
proxy_set_header Accept-Encoding "";

Set rz and sz on Mac

There are a mess of troubles in sending and receiving files from my macbook to dev server, since I had no permission to excute command scp on dev server. Here is a lightweight, quick, and convenience tools which related with ssh, called lrzsz. lrzsz is a unix communication package providing the XMODEM, YMODEM, ZMODEM file transefer protocol which usually has been already installed in most of servers.

Prerequisites

  • iTerm2 is necessary. [Here][] is the official website.
@JJediny
JJediny / gist:a466eed62cee30ad45e2
Created October 5, 2015 20:42
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by