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
'use strict' | |
let f = process.argv[1] | |
console.log('Double negation usage sample. (!!)') | |
console.log('!var => ', !f) | |
console.log('!!var => ', !!f) |
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 | |
//Saves $_GET['url'] parameter to var | |
$reverseURL = $_GET['url']; | |
//Logs the reverse URL to page | |
echo "Reverse URL => " . $reverseURL . "<br />"; | |
//Reverts the $reverseURL string and saves it to var | |
$regularURL = strrev($reverseURL); |
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 | |
//Checks if plain URL was given | |
if ( $_GET['url'] ){ | |
//Encodes $_GET['url'] parameter | |
$encodedURL = base64_encode( urlencode( $_GET['url'] ) ); | |
//Prints out the encoded url | |
echo "Encoded URL => " . $encodedURL . "<br />"; | |
} |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/SITE/html; | |
index index.php index.html index.htm index.nginx-debian.html; | |
server_name SITE.com.br www.SITE.com.br; | |
location ~ \.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 | |
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"])) { | |
return false; | |
} else { | |
$_GET['q'] = $_SERVER['REQUEST_URI']; | |
include __DIR__ . '/index.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
$.ajax({ | |
url : 'handlerURL', | |
type : 'POST', //Cloud be GET/PUT/DELETE/PATCH | |
data : $(form).serialize(), // could be { foo : 'bar', bar : 'foo' } | |
success : function(data){ | |
//Do something with success data | |
}, | |
error : function(error){ | |
//Do something with error data | |
} |
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
letsencrypt certonly --standalone --standalone-supported-challenges http-01 --http-01-port 8080 -d DOMAIN |
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 setRoute = function(file){ | |
var module = require("./controller/" + file) | |
module.map(function(route, index){ | |
routes.set(route.path, route.method, function(req, res, next){ | |
module[index].action(req.params, function(data, code){ | |
res.send(code, data) | |
return next() |
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
#!/bin/bash | |
# Verifica entradas | |
if [ -z $1 ]; then | |
echo "Caminho não informado <br />" | |
exit 1 | |
fi | |
if [ -z $2 ]; then | |
echo "Domínio não informado <br />" | |
exit 1 |
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
<input type="password" id="pwd"> | |
<input type="checkbox" v-model="showPwd"> |
OlderNewer