This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Provides remote server communications options using [curl][ref-curl]. | |
* | |
* [ref-curl]: http://php.net/curl | |
* | |
* @author icyleaf <[email protected]> | |
* @link http://icyleaf.com | |
* @version 0.3.1 | |
* @license http://www.opensource.org/licenses/bsd-license.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* People API - Example Code | |
* | |
* @author icyleaf <[email protected]> | |
* @link http://icyleaf.com | |
* @version 0.1 | |
*/ | |
class Controller_API_People extends Controller_REST { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* img.ly class for Kohana v3.0.x | |
* | |
* @author icyleaf <[email protected]> | |
* @link http://icyleaf.com | |
* @version 0.1 | |
* @license http://www.opensource.org/licenses/bsd-license.php | |
*/ | |
class imgly { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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" /> |
OlderNewer