Skip to content

Instantly share code, notes, and snippets.

Avatar

Supan Adit Pratama supanadit

View GitHub Profile
View Database Office.sql
-- 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 Dynamic Base URL Codeigniter.php
$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 Socket.IO Simple Realtime Reload Table.js
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 api.php
database' => [
'type' => 'mysql',
'host' => 'localhost',
'port' => 3306,
'name' => 'directus_test',
'username' => 'root',
'password' => 'root',
'engine' => 'InnoDB',
'charset' => 'utf8mb4'
]