Skip to content

Instantly share code, notes, and snippets.

View sanhuang's full-sized avatar

Taz Huang sanhuang

View GitHub Profile
@sanhuang
sanhuang / IndexController.php
Last active September 30, 2016 14:48
透過Phalcon修改Dev-Tools,讓產生model檔案時可以讀入欄位註解,並且於Controllers內取出使用方法
In the Action()
```php
$reflection=$this->annotations->get("[modelclass]");
foreach($reflection->getPropertiesAnnotations() as $key => $collection) {
if( $collection->has('comment') ){
$anno=$collection->get('comment');
var_dump($anno->getArgument(0));
}
@sanhuang
sanhuang / README.md
Last active September 27, 2016 09:59
紀錄使用classic ASP各種必要技巧
@sanhuang
sanhuang / README.md
Created September 20, 2016 16:00
PHP套用lib mcrypt做加解密處理方法

從pttnews專案轉移出

使用方式

直接呼叫**encrypt()**進行加密,**decrypt()**進行解密。

// pass-for-check-key
  public $checkval = 'K2Jstudio';
  // chi
  private $password = '2w3e4rr5t62q';
@sanhuang
sanhuang / source_module_forum_forum_image.php
Created September 18, 2016 11:20
WeTalk修改SEO網址作法
dheader('Expires: '.gmdate('D, d M Y H:i:s', TIMESTAMP + 3600).' GMT');
if($attach['remote']) {
$filename = $_G['setting']['ftp']['attachurl'].'forum/'.$attach['attachment'];
} else {
$filename = DISCUZ_ROOT.$_G['setting']['attachdir'].'forum/'.$attach['attachment'];
// $filename = '/home/wetalk/public_html/data/attachment/forum/'.$attach['attachment'];
}
<?php
namespace Personalwork\Auth;
use Phalcon\Events\Event,
Phalcon\Mvc\Dispatcher,
Phalcon\Mvc\User\Plugin;
use Personalwork\Exceptions\AuthExceptions as Exception;
@sanhuang
sanhuang / gist:ffa97a68ac348e867aa7
Created February 25, 2016 13:04 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
var LINE = require('./line.js');
var line = new LINE();
var email = 'your email';
var password = 'your password';
line.login(email, password, function(error, result) {
if (error) {
return;
}