Skip to content

Instantly share code, notes, and snippets.

View manuelmdn's full-sized avatar
👁️
Focusing

Manuel Medina manuelmdn

👁️
Focusing
View GitHub Profile
var http = require('http'),
util = require('util'),
formidable = require('formidable'),
server;
server = http.createServer(function(req, res) {
if (req.url == '/') {
res.writeHead(200, {'content-type': 'text/html'});
res.end(
"<div align='center'>"+
@manuelmdn
manuelmdn / web-servers.md
Created May 5, 2018 04:04 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
//Thanks to https://stackoverflow.com/questions/56414640/paypal-checkout-javascript-with-smart-payment-buttons-create-order-problem
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [
{
reference_id: "PUHF",
description: "Some description",
@manuelmdn
manuelmdn / gist:f6bc63dbd0c1a498792985937a16a62c
Last active May 15, 2020 04:09
Nginx php extension config
//https://stackoverflow.com/questions/21911297/how-to-remove-both-php-and-html-extensions-from-url-using-nginx/21915845#21915845
location / {
try_files $uri $uri.html $uri/ @extensionless-php;
index index.html index.htm index.php;
}
location ~ \.php$ {
try_files $uri =404;
}
@manuelmdn
manuelmdn / gist:cf9d599b70618030ef3cfa8be26c1a84
Created February 17, 2021 18:33
Get Mails Accounts from Cpanel
<?php
#Put this on root cpanel files and execute via terminal
# php getmails.php
$accountcpanel = "";
$domain = "";
$mailpath = "/home/".$accountcpanel."/mail/".$domain;
$mails = glob($mailpath . '/*' , GLOB_ONLYDIR);
foreach($mails as $mail) {