Skip to content

Instantly share code, notes, and snippets.

https://press.one/p/v?s=4ac1aefa932e82a9bfc89c5c1c990d0f201056467eec46dadebc58958201a643e2a15d9179c7f42e9ce86f62a7c21ad43e4f48507fddda1306393419f7a4c0580&h=d3aed01a4af8656e0ed0909ec5926bac7696d6daa1a9b331730242e2090de5d3&a=da4770c1f062aec263ae697ba66209a4695f7c60&f=P1&v=2
#!/bin/bash
#定义常量
git_repo="git@github.com:zhongweili/images.git"
git_path=/Users/$(whoami)/sub
repo_name="images"
github_prefix="https://raw.githubusercontent.com/zhongweili/images/master"
cur_date=$(date +"%Y%m%d")
folder=/Users/$(whoami)/Desktop/
#{query}是alfred workflowy的参数
filename=`echo "{query}" | tr 'A-Z' 'a-z' | tr -s ' ' | tr ' ' '_'`_`date +%s`.png
@zhongweili
zhongweili / image_process.bash
Created November 9, 2018 05:45 — forked from lucifr/image_process.bash
a bash script for Alfred Extension to process screenshot.
#!/bin/bash
#
# requirements:
# - ImageMagick: http://www.imagemagick.org/script/binary-releases.php#macosx
# - image_optim: https://github.com/toy/image_optim
# - a scp supported host with ssh key paired
# setting up the enviroment
export PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH
@zhongweili
zhongweili / listen1_aha_playlist.md
Created August 3, 2018 05:52 — forked from pandakingli/listen1_aha_playlist.md
updated by Listen1(http://listen1.github.io/listen1/) at 2018/6/19 下午3:26:27

本歌单由Listen1创建, 歌曲数:24,歌单数:1,点击查看更多

/**
* 根据uid哈希分表
* @param int $uid
* @param string $tbprefix
* @param int $tbNum
* @return string
*/
public static function get_table_name($uid, $tbprefix, $tbNum=256){
//$ext = dechex(fmod(sprintf("%u", crc32($uid)), $tbNum));