發表文章

目前顯示的是 2月, 2016的文章

[MAC] 刪除擾人的 .DS_Store

打開終端機 cd 到指定目錄 因為刪除指令對某些人來說可能有疑慮,所以先看一下整個結果再確定是否要刪除 $ find . -name ".DS_Store" -depth -exec echo ----{} \; 結果 ----./Library/.DS_Store ----./Library/Application Support/.DS_Store ----./Library/Application Support/com.trankynam.XtraFinder/.DS_Store ----./Library/Application Support/CoRD/.DS_Store ----./Library/Application Support/Developer/Shared/Xcode/.DS_Store ----./Library/Application Support/DEVONthink Pro 2/.DS_Store ----./Library/Application Support/Haroopad/Themes/.DS_Store 正式刪除 find . -name ".DS_Store" -depth -exec rm {} \; 有任何疑問歡迎留言 By 艾摩杰~

[ionic] cordovaPush GCM 推播 範例

安裝 PushPlugin cordova plugin add https://github.com/phonegap-build/PushPlugin.git app.js angular.module('app', ['ionic','ngCordova']) .run(function($ionicPlatform,$cordovaPush,$rootScope) {   $ionicPlatform.ready(function() {     // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard     // for form inputs)     if(window.cordova && window.cordova.plugins.Keyboard) {       cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);     }     if(window.StatusBar) {       // org.apache.cordova.statusbar required       StatusBar.styleDefault();     }       var androidConfig = {       "senderID": "XXXXXXXXXX",     };     $cordovaPush.register(androidConfig).then(function(result) {       //alert(result);     }, function(err) {       alert(err);     })       });   $rootScope.$on('$cordovaPush:notificationReceived', function(event, notification) {     switch(notifi

[PHP] 透過php gd轉圖片以程式方式輸出並在程式中取得參數回傳

#php2img 輸出圖片程式 <?    $pa = $_REQUEST['q'];    $image = "1.jpg";    $img=GetImageSize($image);    switch($img[2]){       case 1:          $im=ImageCreateFromGIF($image);          break;       case 2:          $im=ImageCreateFromJPEG($image);          break;       case 3:          $im=ImageCreateFromPNG($image);          break;    }    $logo = "1.jpg";    $pic=GetImageSize($logo);    switch($pic[2]){       case 1:          $im_pic=ImageCreateFromGIF($logo);          break;       case 2:          $im_pic=ImageCreateFromJPEG($logo);          break;       case 3:          $im_pic=ImageCreateFromPNG($logo);          break;    } //圖片合成    imagecopy($im,$im_pic,0,500,0,0,100,0); //顏色設定    $fc = imagecolorallocate($im,0,0,0); //首先要文字轉utf-8    $str = "文字串放這邊"; //加入浮水印 //imagettftext($image, 大小, 旋轉, 與左邊的距離, 與上面的距離, $black, $font, $text);    imagettftext($im,23,0,35,870,$fc,"msyh.ttf",$str); //建立真實圖片