View api.php
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
database' => [ | |
'type' => 'mysql', | |
'host' => 'localhost', | |
'port' => 3306, | |
'name' => 'directus_test', | |
'username' => 'root', | |
'password' => 'root', | |
'engine' => 'InnoDB', | |
'charset' => 'utf8mb4' | |
] |
View Socket.IO Simple Realtime Reload Table.js
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 app = require('express')(); | |
var http = require('http').createServer(app); | |
var io = require('socket.io')(http); | |
io.on('connection', function(socket){ | |
socket.on("reload-table", function(){ | |
socket.broadcast.emit("reload"); | |
}); | |
console.log('a user connected'); |
View Dynamic Base URL Codeigniter.php
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
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); | |
$config['base_url'] .= "://".$_SERVER['HTTP_HOST']; | |
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); |
View Database Office.sql
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
-- MariaDB dump 10.17 Distrib 10.4.6-MariaDB, for Linux (x86_64) | |
-- | |
-- Host: 127.0.0.1 Database: office | |
-- ------------------------------------------------------ | |
-- Server version 10.4.6-MariaDB | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8mb4 */; |
View Remove Index.php codeigniter .htaccess
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
<IfModule mod_rewrite.c> | |
Options -Indexes | |
RewriteEngine On | |
RewriteCond $1 !^(index\\.php|resources|robots\\.txt) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.+)$ index.php?/$1 [L,QSA] | |
</IfModule> |
View Admin.php
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Belajar Socket.IO</title> | |
<!-- Tell the browser to be responsive to screen width --> | |
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> | |
<!-- Bootstrap 3.3.7 --> | |
<link rel="stylesheet" href="<?= base_url() ?>/assets/bootstrap/dist/css/bootstrap.min.css"> |
View Admin.php
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 | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Admin extends CI_Controller | |
{ | |
public function index() | |
{ | |
$ip = $_SERVER['HTTP_HOST'];; | |
$arrayData = array( |
View Api.php
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 | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Api extends CI_Controller | |
{ | |
public function list_employee() | |
{ | |
header('Content-Type: application/json'); | |
$query = $this->db->get('employee'); | |
if ($query) { |
View main.go
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
package main | |
import "github.com/gin-gonic/gin" | |
func main() { | |
r := gin.Default() | |
r.GET("/test", func(c *gin.Context) { | |
c.JSON(200, gin.H{ | |
"message": "hello", | |
}) |
View Tile38Golang.go
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
package main | |
import ( | |
"flag" | |
"github.com/gorilla/websocket" | |
"log" | |
"net/url" | |
"os" | |
"os/signal" | |
"time" |
OlderNewer