Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name GoogleKingKong
// @namespace http://userstyles.org
// @description 改善 Google 的搜索结果界面,提高阅读效率
// @version 5.6
// @author SUCCESS
// @include http://www.google.*/search*
// @include http://www.google.*/*#*
// ==/UserScript==
/* 更新记录 ***********************************************************************

Keybase proof

I hereby claim:

  • I am d0zingcat on github.
  • I am d0zingcat (https://keybase.io/d0zingcat) on keybase.
  • I have a public key ASDXr5ClrnFbfQHQ-d9Gl6YuqX7ohz8IH-nlE46FjVSc3Qo

To claim this, I am signing this object:

@d0zingcat
d0zingcat / wechat-ofobicyclehacker-app.py
Last active August 14, 2016 17:04
The main feature of one python based back side for wechat official account (Powered by LeanEngine)
# This code is for my post: Using Flask and LeanCloud to build a backend of Wechat Official Account
# welcome to visit the post: https://blog.d0zingcat.xyz/2016/07/24/Python/Using%20Flask%20and%20LeanCloud%20to%20build%20a%20backend%20of%20Wechat%20Official%20Account/#more
# coding: utf-8
from datetime import datetime
from flask import render_template, Flask, request, make_response, jsonify, abort
from flask_sockets import Sockets
from views.todos import todos_view
import xml.etree.ElementTree as ET
@d0zingcat
d0zingcat / picpatch.py
Created March 30, 2017 13:23
This is a py-program to patch JPEG Photos to prevent auto-rotate in markdown files.
from PIL import Image
import os, argparse, pexif
def picProcessing(picPath, isForce=False):
try:
img = pexif.JpegFile.fromFile(picPath)
@d0zingcat
d0zingcat / markdown notes.md
Last active December 1, 2017 05:02
markdown notes
  1. Anchor at current page Github automatically parses anchor tags out of your headers. So you can do the following:
[Foo](#foo)
### Foo

In the above case, the Foo header has generated an anchor tag with the name foo

Note: just one # for all heading sizes, no space between # and anchor name, anchor tag names must be lowercase, and delimited by dashes if multi-word. Just like this:

@d0zingcat
d0zingcat / java notes.md
Last active December 1, 2017 05:03
java notes

单例模式

单例模式的主要作用是保证在Java程序中,某个类只有一个实例存在。一些管理器和控制器常被设计成单例模式。

单例模式有很多好处,它能够避免实例对象的重复创建,不仅可以减少每次创建对象的时间开销,还可以节约内存空间;能够避免由于操作多个实例导致的逻辑错误。如果一个对象有可能贯穿整个应用程序,而且起到了全局统一管理控制的作用,那么单例模式也许是一个值得考虑的选择。

Maven

https://ide.c9.io/d0zingcat/dailylabs | dailylabs - Cloud9
https://miki725.github.io/docker/crypto/2017/01/29/docker+nginx+letsencrypt.html | Docker + Nginx + LetsEncrypt — » Miroslav Shubernetskiy
https://github.com/jwilder/nginx-proxy | jwilder/nginx-proxy: Automated nginx proxy for Docker containers using docker-gen
https://github.com/clarkzjw/nginx-proxy-google | clarkzjw/nginx-proxy-google: Docker image of Nginx reverse proxy for Google
https://stackoverflow.com/questions/24241292/dockerized-nginx-is-not-starting | docker - Dockerized nginx is not starting - Stack Overflow
https://bitbucket.org/account/signin/
https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html | Set up an SSH key - Atlassian Documentation
https://hub.docker.com/ | Docker Hub
https://www.linux.com/news/5-linux-desktop-environments-rise-2017 | 5 Linux Desktop Environments on the Rise for 2017 | Linux.com | The source for Linux information
https://www.ubuntupit.com/install-various-desktop-environment-ubuntu/ | 13 B
@d0zingcat
d0zingcat / linux notes.md
Last active December 18, 2017 08:22
linux notes

Without other narrates, this note is only intended for Debian or Ubuntu.

command function usage
update-alternatives multi-version runnable program preference management
test -x ${file} test if ${file} exists and granted with executable permission
if [ -f ${file} ] test if this file is a regular file
set -e cause the shell to exit if any subcommand or pipeline returns a non-zero status
@d0zingcat
d0zingcat / mess notes.md
Last active December 20, 2017 16:21
mess notes

Docker notes

  1. docker Network differenece between EXPOSE and PUBLISH: Exposing ports is a way of documenting which ports are used, but does not actually map or open any ports. Exposing ports is optional.

Best practives in [?]nix

command line proxy: proxychains

@d0zingcat
d0zingcat / git notes.md
Last active December 20, 2017 16:24
git notes
commands scope common user cases
git reset Commit Discard commits in a private branch or throw away uncommited changes
git reset File Unstage a file
git checkot Commit switch between branches or inspect old snapshot
git checkout File Discard changes in the working directory
git revert commit Undo commits in a public branch
git revert File 不支持
git push -u origin master persistence on next push, "origin master" can be ommitted.