Skip to content

Instantly share code, notes, and snippets.

@cgiovanii
cgiovanii / functionSerializeToJson
Last active March 31, 2020 19:16
Function to convert serialized data from form to json format #JS
// Envia a encomenda para o mailer.
function serializeToJson(form) {
//Pega os dados do form serializa e converte para objeto
let data = $(form).serialize().split("&");
let dataObj = {};
for (var key in data) {
dataObj[data[key].split("=")[0]] = data[key].split("=")[1];
}
//Converte o objeto para json
let dados = JSON.stringify(dataObj)
@cgiovanii
cgiovanii / .eslintrc.js
Last active June 11, 2019 00:58
A sample .eslintrc file
var OFF = 0, WARN = 1, ERROR = 2;
module.exports = exports = {
"env": {
"es6": true
},
"ecmaFeatures": {
// env=es6 doesn't include modules, which we are using
"modules": true
@cgiovanii
cgiovanii / README.md
Last active January 28, 2022 22:57
.jsbeautifyrc files examples to use with my projects.

Usage

Copy this clean.jsbeautifyrc.json file to .jsbeautifyrc in your root project folder.

Precondition:

  • hookyqr.beautify is installed
  • .jsbeautifyrc exist
@cgiovanii
cgiovanii / Dockerfile
Last active June 12, 2019 23:00
Stack Development Web
FROM php:7.2-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libmcrypt-dev \
&& pecl install mcrypt-1.0.1 \
&& docker-php-ext-enable mcrypt \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
@cgiovanii
cgiovanii / docker-composer.yml
Last active December 9, 2017 18:26
Docker LAMP Server - Apache2+Php7+MySql5+PhpMyAdmin+Portainer #Docker #LAMP
version: '2'
services:
webserver:
depends_on:
- db
image: php:7-apache
container_name: Apache2-PHP7
restart: always
volumes:
- ./public_html:/var/www/html/
version: "2"
services:
web:
image: nginx:latest
container_name: Nginx
ports:
- "80:80"
volumes:
- ./public:/public
@cgiovanii
cgiovanii / general.cfg
Last active February 21, 2023 06:13
Veinminer config - Put this file in veinminer config folder, to activate veinminer in game you just need to sneak and hit on block until he break.
# Configuration file
##########################################################################################################
# autodetect
#--------------------------------------------------------------------------------------------------------#
# Autodetect items and blocks during game start-up.
##########################################################################################################
autodetect {
# Autodetect blocks with the below prefixes in the ore dictionary, adding the names to the axe list. [default: true]
@cgiovanii
cgiovanii / wp.sh
Last active April 21, 2019 14:19 — forked from sebolio/wp.sh
Permicoes Wordpress
sudo chown www-data:www-data -R * # Let apache be owner
find . -type d -exec sudo chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec sudo chmod 644 {} \; # Change file permissions rw-r--r--
@cgiovanii
cgiovanii / CHANGEME.app.conf
Created October 28, 2016 01:35
Ngnix vhost template
server {
listen 80;
server_name CHANGEME.app;
root /var/www/vhosts/CHANGEME.app/public;
index index.html index.htm index.php;
charset utf-8;
location / {
@cgiovanii
cgiovanii / Minimal-Flat-Devices-*Responsive*.markdown
Created December 1, 2014 01:25
Minimal Flat Devices *Responsive*