Skip to content

Instantly share code, notes, and snippets.

@jiaozhu
jiaozhu / .vimrc
Created September 10, 2019 03:11
set nobackup
set noswapfile
set number
set cindent
set autoindent
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
set ruler

Keybase proof

I hereby claim:

  • I am jiaozhu on github.
  • I am jiaozhu (https://keybase.io/jiaozhu) on keybase.
  • I have a public key whose fingerprint is C224 740D ABAB 2FB2 48B5 C532 6DB5 5B98 E34C E3E4

To claim this, I am signing this object:

@jiaozhu
jiaozhu / dunstrc
Created December 24, 2018 11:27
dunstrc
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
@jiaozhu
jiaozhu / .Xresources
Last active December 24, 2018 02:28
Xresources 配置文件,依赖于 rxvt-unicode 及 urxvt-perls
!! The default colors are "Gruvbox":
*.color0: #1d2021
*.color1: #cc241d
*.color2: #98971a
*.color3: #d79921
*.color4: #458588
*.color5: #b16286
*.color6: #689d6a
*.color7: #a89984
*.color8: #928374
@jiaozhu
jiaozhu / lightdm-gtk-greeter.conf
Created December 22, 2018 14:51
lightdm-gtk-greeter.conf
[greeter]
background = /usr/share/pixmaps/wall.png
theme-name = Arc-Gruvbox
icon-theme-name = Adwaita
font-name = Source Code Pro 9
indicators = ~~Wythe's Arch Linux Box;~spacer;~clock;~spacer;~session;~power
clock-format = %Y %b %d (%a) %I:%M %p
@jiaozhu
jiaozhu / iterm2_badges.md
Created June 23, 2018 05:52 — forked from criaturaExperimental/iterm2_badges.md
Customizing badges for iTerm2

Customizing iTerm badges

There are two variables available to use in the badge field with

\(user.gitBranch) \n \(user.humpDay)
  • gitBranch shows the current branch the folder opened in the terminal is
  • humpDay shows an icon according to the date

This code goes into ~/.bash_profile

@jiaozhu
jiaozhu / AutowiringSpringBeanJobFactory.java
Created September 29, 2016 18:04 — forked from jelies/AutowiringSpringBeanJobFactory.java
Quartz (2.1.6) java config with spring (3.2.1). Using a SpringBeanJobFactory to automatically autowire quartz classes.
package com.jelies.spring3tomcat7.config.quartz;
import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.quartz.SpringBeanJobFactory;
/**
* This JobFactory autowires automatically the created quartz bean with spring @Autowired dependencies.
@jiaozhu
jiaozhu / oracleJDBCSetup
Created September 29, 2016 15:03 — forked from MonicaG/oracleJDBCSetup
Using Oracle with Spring Boot
If you do not have an oracle driver do steps 1 and 2 first. Otherwise skip to step 3.
1) Download the jdbc driver from oracle.
2) Install the driver into your local maven .m2 repository. Example:
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.4 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true
In the above example the ojdbc6.jar version 11.2.0.4 is used. Replace the -DartifactId=ojdbc6 -Dversion=11.2.0.4 and -Dfile=ojdbc6.jar with the driver name/version you downloaded.
import requests
def send_request():
# My API
# POST https://passport.hupu.com/pc/login/member.action
try:
response = requests.post(
url="https://passport.hupu.com/pc/login/member.action",
@jiaozhu
jiaozhu / QNUploader.swift
Created December 4, 2015 05:41
Upload images to Qiniu via multipart-form with Alamofire
//
// QNUploader.swift
//
// Created by Lex on 12/1/15.
//
import Foundation
import Alamofire
private let kCDNDomain = "__YOUR_QINIU_CDN_DOMAIN__"