Skip to content

Instantly share code, notes, and snippets.

View alswl's full-sized avatar

Jingchao alswl

View GitHub Profile
# coding=utf-8
from __future__ import unicode_literals, absolute_import, print_function
import logging
from io import BytesIO
import base64
import requests
from PIL import Image
@alswl
alswl / release-to-git-release-binary-branch.sh
Last active August 4, 2017 08:35
sbt release to release-binary branch
#!/bin/bash
set -x
sbt assembly
GIT_HASH=`git rev-parse --short HEAD`
BRANCH=release-binary-`date +%y%m%d.%H%M`-$GIT_HASH
TAG=v-`date +%y%m%d.%H%M`
git tag $TAG
git push origin $TAG
@alswl
alswl / bin scripts for java
Last active August 29, 2017 03:44
common JVM start bin
# bin scripts for java
# coding=utf-8
import sys
import time
import logging
import redis
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
@alswl
alswl / hosts
Last active October 8, 2024 09:13
(deprecated, I bought xiaomi VIP)hosts for OpenWRT, for disable AD in xiaomi TV
127.0.0.1 api.ad.xiaomi.com
127.0.0.1 sdkconfig.ad.xiaomi.com
127.0.0.1 ad.mi.com
127.0.0.1 ad.xiaomi.com
127.0.0.1 ad1.xiaomi.com
127.0.0.1 adv.sec.miui.com
127.0.0.1 test.ad.xiaomi.com
127.0.0.1 new.api.ad.xiaomi.com
@alswl
alswl / service.sh
Last active May 25, 2017 07:06 — forked from naholyr/_service.md
Sample /etc/init.d script # modified for command + options
#!/bin/sh
### BEGIN INIT INFO
# Provides: <NAME>
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: <DESCRIPTION>
### END INIT INFO
@alswl
alswl / squirrel.custom.yaml
Last active March 8, 2017 11:23
squirrel theme, Rime homepage style, http://rime.im/
patch:
app_options: []
style:
color_scheme: homepage
preset_color_schemes:
homepage:
name: "官网 / Homepage" # snapshot http://rime.im/images/home-feature-1.svg http://rime.im/images/home-feature-4.svg
author: "alswl"
horizontal: true
inline_preedit: true
@alswl
alswl / requests.py
Created February 9, 2017 09:47
one function simple requests for Python
#!/usr/bin/env python
# coding: utf-8
import urllib
import urllib2
def _request(path, params=None, method='GET', data=None, headers=None):
params = params or {}
headers = headers or {}
@alswl
alswl / luna_pinyin.emoji.apple.dict.yaml
Last active January 11, 2020 03:03
(deprecated) emoji pinyin mapping for Rime input. data from MacOS(鼠须管、小狼毫、中州韵配置,将 MacOS 数据导入)PS:sierra 之后的数据格式发生变化,未更新,比如没有培根 🥓。新版 Emoji(支持到 Emoji 12.0)可以见更完整的 Rime 配置 https://github.com/alswl/Rime
# luna_pinyin.emoji.apple.dict.yaml by alswl
# encoding: utf-8
---
name: luna_pinyin.emoji.apple
version: "2016.12.28"
sort: by_weight
use_preset_vocabulary: true
...
@alswl
alswl / README.md
Last active November 7, 2016 10:31
usopp, vote robot via HTTP Proxy

usage

bash usopp.sh proxy.txt

Tips

remember update proxy.txt.