Skip to content

Instantly share code, notes, and snippets.

View samma835's full-sized avatar

samma samma835

  • Shanghai
View GitHub Profile
@samma835
samma835 / get_constellation.php
Created October 29, 2012 13:48
根据日期获取星座
// $birthday的格式为yyyy-mm-dd
public function getConstellation($birthday, $format=null)
{
$pattern = '/^\d{4}-\d{1,2}-\d{1,2}$/';
if (!preg_match($pattern, $birthday, $matchs))
{
return null;
}
$date = explode('-', $birthday);
@samma835
samma835 / slide_in_up.xml
Created October 22, 2012 07:31
animation of android(ep.ImageSwitcher)
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="500"
android:fromYDelta="-50%p"
android:toYDelta="0" />
<alpha
android:duration="500"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>