Skip to content

Instantly share code, notes, and snippets.

# RESOLVENDO GOOGLE CHROME NO TERMINAL
sudo xattr -lr /Applications/Google\ Chrome.app
sudo xattr -cr /Applications/Google\ Chrome.app
sudo codesign -f -s - /Applications/Google\ Chrome.app
@guigmaster
guigmaster / .dockerignore
Created February 26, 2020 19:06
Docker for Angular Projects
node_modules
.git
.gitignore
@guigmaster
guigmaster / mysqldumps.sh
Last active January 4, 2021 20:13
Coleção de utilitários para dump de dados pelo mysql
# Realiza o backup completo com estrutura, dados views, procedures, functions e triggers
# utilizando insert completo pela option --complete-insert
# alem de converter os binários para hexadecimal com a option --hex-blob
# inclui CREATE BATABASE option -B
mysqldump -u username -p --opt --complete-insert --hex-blob --routines -B databasename > databasename.sql
# Realiza o backup da estrutura tanto tables quanto views
# exclui as triggers otion --skip-triggers
# ignora os dados --no-data
@guigmaster
guigmaster / default.conf
Created February 22, 2017 11:23
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@guigmaster
guigmaster / change_extension.sh
Last active December 7, 2016 09:56
Bash tips and Utils
find . -name "*.t1" -exec bash -c 'mv "$1" "${1%.t1}".t2' - '{}' \;
SELECT CONCAT("ALTER TABLE ", TABLE_NAME," CHARSET=utf8, COLLATE=utf8_general_ci;") AS ExecuteTheString
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA="dababase"
AND TABLE_TYPE="BASE TABLE"
@guigmaster
guigmaster / parsley.cnpj-validator.js
Last active January 30, 2020 17:18
Custom's Parsley Validator's
'use strict';
(function($) {
window.ParsleyValidator
.addValidator('validcnpj', function (value, requirement) {
var cnpj = value.replace(/[^0-9]/g, '')
, len = cnpj.length - 2
, numbers = cnpj.substring(0,len)
, digits = cnpj.substring(len)
, add = 0
@guigmaster
guigmaster / serverUrl.php
Created July 6, 2015 14:10
Get full url include schema, port and optional request uri
<?php
function serverUrl($requestUri = null) {
switch (true) {
case (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] === true)):
case (isset($_SERVER['HTTP_SCHEME']) && ($_SERVER['HTTP_SCHEME'] == 'https')):
$scheme = 'https';
break;
default:
$scheme = 'http';
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
@guigmaster
guigmaster / GsonRequest.java
Created January 20, 2015 18:09
GsonRequest a Volley adapter for JSON requests using Google Gson Lib
public class GsonRequest<T> extends Request<T> {
private Gson gson = new Gson();
private Class<T> model;
private Map<String, String> params;
private Map<String, String> headers;
private Listener listener;
public GsonRequest(int method, String url, Class<T> model, Map<String, String> params, Map<String, String> headers,