Skip to content

Instantly share code, notes, and snippets.

@icyleaf
icyleaf / .vimrc
Last active March 3, 2016 09:12
vim config (Mac OS + vim + vundle)
" Vim Config
" Source: http://www.integralist.co.uk/posts/vim-workflow-part-deux/
" switch syntax highlighting on, when the terminal has colors
syntax on
" use vim, not vi api
set nocompatible
" no backup files
@icyleaf
icyleaf / centos.md
Last active December 28, 2015 18:19

Postgresql

$ sudo rpm -i http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
$ sudo yum update
$ sudo yum install -y postgresql93-server postgresql93-contrib postgresql93-client

postgresql contrib path: /usr/pgsql-9.3/share/extension/

$ psql -d {database_name} -f /usr/pgsql-9.3/share/extension/hstore.sql

or in sql shell: create extension hstore;

listen all address

@icyleaf
icyleaf / 呼伦贝尔骑行计划书.md
Last active December 21, 2021 12:05
呼伦贝尔骑行计划书

呼伦贝尔骑行计划书

出行时间

2013.6.9 ~ 6.16 (端午+请两天假+周末)

计划安排 16 日到达北京,不影响 17 日正常上班。

总公里数

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
@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
@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 / 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 / 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 / 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 / .tmux.conf
Last active April 18, 2017 10:30
my tmux config file
# tmux source-file ~/.tmux.conf
# author: icyleaf <[email protected]>
# Golbal
## using the default prefix hotkey
set -g prefix C-a
## Options
set -g base-index 1