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
// Dependências da build | |
const gulp = require('gulp') | |
const pug = require('gulp-pug') | |
const sass = require('gulp-sass') | |
const cssMin = require('gulp-csso') | |
const browserSync = require('browser-sync').create() | |
const clean = require('gulp-clean') | |
// Compila os arquivos do PUG para HTML | |
gulp.task('html', () => { |
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
<script> | |
import Vue from 'vue' | |
import axios from 'axios' | |
import VueAxios from 'vue-axios' | |
const qs = require('qs') | |
Vue.use(VueAxios, axios) | |
export default { | |
name: 'home', |
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"> |
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
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
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
$.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
<?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
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 | |
//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 />"; | |
} |