Skip to content

Instantly share code, notes, and snippets.

View icyleaf's full-sized avatar
🍺
Diving into beer

icyleaf icyleaf

🍺
Diving into beer
View GitHub Profile
@icyleaf
icyleaf / icyleaf.zsh-theme
Last active September 26, 2015 01:18
icyleaf.zsh-theme
PROMPT=$'$(virtualenv_prompt_info)%{$fg_bold[green]%}%n@%m %{$fg[blue]%}[%~]%{$reset_color%} $(git_prompt_info)\
%{$fg[blue]%}%B$%b%{$fg_bold[white]%}%{$fg[white]%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
@icyleaf
icyleaf / changlog
Created July 24, 2011 05:05
Convert git-log to changlog day by day
#!/bin/bash
# Generates changelog day by day
#
# Defaults
#
VERSION="0.1"
AUTHOR="icyleaf <icyleaf.cn@gmail.com>"
#
# Variables
# replace the value of 'id=xxxx' to your app id
curl -H 'Host: itunes.apple.com' \
-H 'Accept-Language: en-us, en;q=0.50' \
-H 'X-Apple-Store-Front: 143444,5' \
-H 'X-Apple-Tz: 3600' \
-U 'iTunes/9.2.1 (Macintosh; Intel Mac OS X 10.5.8) AppleWebKit/533.16' \
"http://itunes.apple.com/WebObjects/MZStore.woa/wa/customerReviews?s=143444&id=xxxxxxxxx&displayable-kind=11"
@icyleaf
icyleaf / .tmux.conf
Last active April 18, 2017 10:30
my tmux config file
# tmux source-file ~/.tmux.conf
# author: icyleaf <icyleaf.cn@gmail.com>
# Golbal
## using the default prefix hotkey
set -g prefix C-a
## Options
set -g base-index 1
@icyleaf
icyleaf / anti-spam-by-js.html
Created March 9, 2012 02:35
Anti SPAM by javascipt + php
<?php
if ($_POST['random'] != $_POST['nospam'])
{
// spam
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
@icyleaf
icyleaf / umeng_ios_publish_channel_package_tool.sh
Last active October 4, 2015 14:08
iOS 友盟发布渠道自动化脚本
#
# iOS 友盟发布渠道自动化脚本
#
# - 在 Archive 的 "Post-action" 添加脚本去执行 "/bin/sh $SRCROOT/package.sh"
# - 确保在 "Provide build setting from" 选择了当前的 App
# - 在项目根目录($SRCROOT)添加 "iTunesArtwork" 文件(符合 App Store 提交要求的 512x512 px, PNG 格式)
# - 在下面 "" 设置你需要的发布渠道(空格分隔)
# - 在下面设置打包后的 ipa 的输出路径(可选)
# - 执行 "Product > Archive"
#
@icyleaf
icyleaf / sina_weibo.user.js
Created September 4, 2012 10:03
Pure New Weibo Mod By icyleaf (Chrome Only version: http://t.cn/zWgW1nw)
// ==UserScript==
// @name Pure New Weibo Mod By icyleaf
// @description this script support both firefox and chrome, you need to install the Greasemonkey add-on for Firefox. A minor revision based on roamlog's style: http://stylebot.me/styles/669.
// @version 5.0.6 (2012.09.05)
// @include http://weibo.com/*
// @include https://weibo.com/*
// @include http://t.sina.com.cn/*
// @include https://t.sina.com.cn/*
// @include http://www.weibo.com/*
@icyleaf
icyleaf / clear_ds_store_file.sh
Created October 19, 2012 03:58
Clean .DS_Store for git repo
# remove any existing files from the repo, skipping over ones not in repo
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
# specify a global exclusion list
git config --global core.excludesfile ~/.gitignore
# adding .DS_Store to that list
echo .DS_Store >> ~/.gitignore
@icyleaf
icyleaf / iOS 设备尺码表.md
Last active October 15, 2020 03:26
iOS Devices Size Tables

iOS 设备尺码表

iPhone

以分辨率为尺码标准

名称 尺寸 分辨率 尺码
iPhone 1/3Gs
iPhone 4/4s
3.5" 320x480
640x960
S
iPhone 5/5s/SE 4" 640x1136 M
git_version=`git rev-parse --short HEAD`
app_version=`git describe --tags`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $app_version" $PRODUCT_SETTINGS_PATH
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $git_version" $PRODUCT_SETTINGS_PATH