Skip to content

Instantly share code, notes, and snippets.

# 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 / 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 <[email protected]>"
#
# Variables
@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 / AndroidManifest.xml
Last active December 20, 2016 07:03
Android package based UMeng analytics
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<application ...>
<activity ...>
<meta-data android:name="UMENG_APPKEY" android:value="UMENG-API-KEY" />
<meta-data android:name="UMENG_CHANNEL" android:value="Development" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
#!/bin/sh
# Change this line to the URI path of the xcode DMG file.
# XCode 3.2.5
#XCODE_PATH="/ios/ios_sdk_4.2__final/xcode_3.2.5_and_ios_sdk_4.2_final.dmg"
# XCode 4
#XCODE_PATH="/Developer_Tools/xcode_4_and_ios_sdk_4.3__final/xcode_4_and_ios_sdk_4.3__final.dmg"
@icyleaf
icyleaf / download_alpaca.sh
Created January 9, 2011 03:24
This script is a helper that it will help you download Alpaca and initial structure to current path.
#!/bin/bash
#
# This script is a helper that it will help you download Alpaca and initial structure to current path.
# To install elsewhere you can just clone https://github.com/icyleaf/alpaca anywhere you like.
#
# AUTHOR icyleaf <[email protected]>
# VERSION 0.1
#
echo "Clone the alpaca project from Github"
@icyleaf
icyleaf / post-receive.sh
Created September 6, 2010 07:55
git autodeploy script when it matches the string "[deploy]"
#!/bin/sh
#
# git autodeploy script when it matches the string "[deploy]"
#
# @author icyleaf <[email protected]>
# @link http://icyleaf.com
# @version 0.1
#
# Usage:
# 1. put this into the post-receive hook file itself below
@icyleaf
icyleaf / text.php
Created July 5, 2010 10:41
Parse HTML entries for allowed tags
<?php
/**
* Parse HTML entries for allowed tags
*
* @author icyleaf <[email protected]>
* @version 0.1
*/
class Text extends Kohana_Text{
//don't parse anything in these tags
public static $literals = array('code', 'pre');
@icyleaf
icyleaf / consumer_key.php
Created June 18, 2010 07:26
consumer_key
<?php
function new_consumer_key()
{
// in case /dev/urandom is reusing entropy from its pool, let's add a bit more entropy
$entropy = uniqid(mt_rand(), true);
$hash = sha1($entropy); // sha1 gives us a 40-byte hash
// The first 30 bytes should be plenty for the consumer_key
// We use the last 10 for the shared secret
return array(
@icyleaf
icyleaf / Validate.php
Created June 10, 2010 08:26
Validate a Chinese ID
class Validate {
/**
* Validate a Chinese ID (18 digit ONLY).
* @param int ID
* @return boolean
*/
public static function chinese_id($id)
{
$id_length = strlen($id);
if ($id_length == 18)