Skip to content

Instantly share code, notes, and snippets.

View kcyeu's full-sized avatar

Kuo-Cheng Yeu kcyeu

View GitHub Profile
@kcyeu
kcyeu / PHP4 Pagination 1-2.php
Last active August 29, 2015 14:10
PoC of PHP4 pagination, footer part.
<table width="400" align="center">
<tr>
<td><?echo "共 $totalpage 頁,現在是第 $page 頁";?>
</td>
<td>
<a href="<?=$PHP_SELF?>?page=1">最前頁</a>
<?php
if($page != 1)
{
echo "<a href=\"$PHP_SELF?page=" . ($page-1) . "\">上一頁</a>";
@kcyeu
kcyeu / PHP4 Pagination 1-1.php
Last active August 29, 2015 14:10
PoC of PHP4 pagination, header part.
<?php
include("../config.php");
$result = mysql_query("SELECT * FROM member");
$total = mysql_num_rows($result);
//若無設定$page, 則預設為1
if(!isset($page)) (int)$page=1;
//每頁設定顯示筆數
$page_num = 2;
@kcyeu
kcyeu / docker-selenium.sh
Last active August 29, 2015 14:10
Command line to start Selenium
#!/bin/sh
sudo docker run -d -p 4444:4444 --name selenium-hub selenium/hub
sudo docker run -d --link selenium-hub:hub selenium/node-chrome
sudo docker run -d --link selenium-hub:hub selenium/node-firefox
@kcyeu
kcyeu / fig.yml
Created November 26, 2014 08:03
Use Fig to launch full function Selenium Grid2
hub:
image: selenium/hub
ports:
- "4444:4444"
chrome:
image: selenium/node-chrome
links:
- hub:hub