Skip to content

Instantly share code, notes, and snippets.

View jaredchu's full-sized avatar
🏘️
Working from home

Jared Chu jaredchu

🏘️
Working from home
View GitHub Profile
@jaredchu
jaredchu / node.js
Created June 6, 2021 08:05
Node.js test index file
const http = require('http');
const hostname = '';
const port = 4000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});
@jaredchu
jaredchu / index.html
Created June 18, 2021 08:20
index.html redirect template
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0; url=http://your-domain.com/" />
</head>
</html>
<?php
/**
* Get both the local and master values of a PHP configuration directive.
*
* @param string $directive The name of the PHP configuration directive (e.g., 'memory_limit').
* @return array Associative array with 'local' and 'master' values.
*/
function get_php_config_values(string $directive): array {
// Get the local value
$local_value = ini_get($directive);