This file contains hidden or 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 | |
$input = "2015-08-21 05:55:19 GMT"; | |
$gmt_date = DateTime::createFromFormat( | |
'Y-m-d H:i:s T', | |
$input); | |
$ict_date = clone $gmt_date; | |
$ict_date->setTimeZone(new DateTimeZone('Asia/Bangkok')); |
This file contains hidden or 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
package com.example.peerapong.chatio; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
import android.view.View; | |
import android.widget.EditText; | |
import android.widget.ImageView; | |
import android.widget.ListView; | |
import android.widget.RelativeLayout; |
This file contains hidden or 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
# Preconfiguration setup | |
groupadd mysql | |
useradd -r -g mysql -s /bin/false mysql | |
# Beginning of source-build specific instructions | |
tar zxvf mysql-VERSION.tar.gz | |
cd mysql-VERSION | |
cmake . | |
make | |
make install | |
# End of source-build specific instructions |
This file contains hidden or 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
#CentOS 6 (Game Server) | |
wget http://repo.mysql.com/mysql-community-release-el6-4.noarch.rpm | |
rpm -Uvh mysql-community-release-el6-*.noarch.rpm | |
yum install mysql-community-server | |
sudo service mysqld start | |
#CentOS 5 (Login Server) | |
yum install mysql-server mysql | |
sudo service mysqld start |
This file contains hidden or 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 Login extends CI_Controller | |
{ | |
public function index() | |
{ | |
$this->load->helper('form'); | |
$this->load->view('login'); | |
} | |
} |
This file contains hidden or 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 | |
$conn = mysqli_connect('localhost', 'root', '12345678', 'test'); | |
mysqli_set_charset($conn, 'utf8'); | |
$result = mysqli_query($conn, 'SELECT * FROM province;'); | |
if ($result) { | |
while ($row = mysqli_fetch_assoc($result)) { |
This file contains hidden or 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 | |
$users = [ | |
[ | |
"_id"=> "574ec9608236b128d88e62ec", | |
"name"=> "Mack Santiago", | |
"age"=> 26, | |
"email"=> "[email protected]" | |
], | |
[ | |
"_id"=> "574ec96081802773dbb647fc", |
This file contains hidden or 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
package com.example.android; | |
import android.os.Bundle; | |
import android.support.annotation.Nullable; | |
import android.support.v4.app.Fragment; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; |
This file contains hidden or 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
package com.peerapongme.labs.java101rxjava; | |
import java.util.Scanner; | |
/** | |
* Created by peerapong on 8/22/16. | |
*/ | |
public class Program { | |
public static void main(String[] args) { |
This file contains hidden or 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 | |
$orig = array(-1, 0, 1, 2, 3, 4, -2, -4, -5, 6, -6, -7, 8); | |
usort($orig, function ($a, $b) { | |
if ($a > 0) { | |
return ($a < $b) ? -1 : 1; | |
} else { | |
return ($a > $b) ? -1 : 1; | |
} | |
}); |
OlderNewer