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
CREATE TRIGGER insert_enc BEFORE INSERT ON dmhy_lists | |
FOR EACH ROW | |
BEGIN | |
IF UPPER(NEW.title) REGEXP '(繁|BIG5)' THEN | |
SET NEW.enc = '1'; | |
ELSEIF UPPER(NEW.title) REGEXP '(简|GB)' THEN | |
SET NEW.enc = '2'; | |
END IF; | |
END; |
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
var web = require('webpage'); | |
var client = web.create(); | |
var fs = require('fs'); | |
var file = "/var/www/tmp/dmhy_programme.html"; | |
client.open('http://share.dmhy.org/cms/page/name/programme.html', function(status){ | |
if (status === 'success') | |
{ |
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 | |
class clef_login extends CI_Controller | |
{ | |
private $app_id = ''; // 填寫拿到的app_id | |
private $app_secret = ''; // 填寫拿到的app_secret | |
public function __construct () | |
{ | |
parent::__construct(); | |
session_start(); |
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 | |
$api_key = 'xxxxxxxxxxxxx'; // 在註冊帳號後進入dashboard就可以看到了 | |
$collection = 'sample'; // 資料放置/讀取的容器 | |
// 存取API的路徑 | |
$base_url = 'https://api.orchestrate.io/v0/'.$collection; | |
// 塞入資料 | |
$key = 'sample'; // 存放資料時作為識別的key | |
$data_insert = array('a'=>'1', 'b'=>'2', 'c'=>'3'); |
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 | |
// API的基本路徑 | |
$url = 'http://example.com/api/v3'; | |
// 因為要列出projects,所以加上/projects | |
$url .= '/projects'; | |
// GitLab認證的方式有兩種,一種是把private_token放在query_string內,另一種是放在http header內 | |
// 可以根據自己需求來決定怎麼用。 |
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
{"header":{"num":23690,"start":"0","perpage":"50"},"artworks":[{"id":"41013348","author_id":"4075119","site":"pixiv","title":"\u9032\u6483\u306e\u5341\u4e8c\u652f\/\u3042\u305f\u308a\u3081","thumbnail":"http:\/\/cdn-pixiv.maid.tw\/thumb\/41013348_12efb_thumb.jpg","r_18":"false","original_url":"http:\/\/www.pixiv.net\/member_illust.php?mode=medium&illust_id=41013348","page_url":"http:\/\/neko.maid.tw\/pixiv\/4075119\/41013348","photos":[{"image":"http:\/\/cdn-pixiv.maid.tw\/41013348_12efb.jpg","width":1490,"height":2100}],"tags":["\u9032\u6483\u306e\u5de8\u4eba","104\u671f\u751f","\u306a\u306b\u3053\u308c\u304b\u308f\u3044\u3044","\u8fb0\u5e74\u306a\u306e\u3067\u30d9\u30eb\u3055\u3093\u9802\u6234\u3057\u307e\u3059","\u79c1\u306f\u514e\u5e74\u306a\u306e\u3067\u30de\u30eb\u30b3\u3092\u9802\u304d\u307e\u3059\u3002","\u9149\u5e74\u306a\u306e\u3067\u30a2\u30cb\u3092\u3044\u305f\u3060\u3044\u3066\u3044\u304d\u307e\u3059","\u79c1\u306f\u5348\u5e74\u306a\u306e\u3067\u30b8\u30e3\u30f3\u3092\u9802\u304d\u307e\u3059\u30 |
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
tmpdir=tmp | |
if [ -d "$tmpdir" ]; then | |
rm -rf $tmpdir | |
fi | |
mkdir $tmpdir | |
height=2592 | |
width=10 | |
n=0 | |
for f in *.jpg | |
do |
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 | |
foreach($dailyDetail[$key1] as $key2=>$value){ | |
if($key1==0){ | |
if($key2==0 ||$key2==1 ||$key2==2|| $key2==3 || $key2==4 || $key2==5 ||$key2==$dailyRevenueNum-2||$key2==$d ailyRevenueNum-3||$key2==$dailyRevenueNum-1){ | |
$dailyDetail[$key1][$key2]['style']='s41'; | |
} | |
else{ | |
$dailyDetail[$key1][$key2]['style']='s42'; | |
} |
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
import java.util.Scanner; | |
class test { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) throws java.lang.Exception { | |
// TODO Auto-generated method stub | |
try { |
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
import java.io.*; | |
import java.util.Scanner; | |
class test { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) throws java.lang.Exception { | |
// TODO Auto-generated method stub |