Skip to content

Instantly share code, notes, and snippets.

View viniciusbig's full-sized avatar

Vinicius Arantes viniciusbig

  • CI&T
  • Campinas - SP - Brazil
View GitHub Profile
@viniciusbig
viniciusbig / wp.sh
Created January 16, 2019 21:36 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@viniciusbig
viniciusbig / correios.html
Created December 9, 2018 22:53
Link direto para a pagina dos correios rastreando encomenda
<form id="shipping-correo" method="POST" target="_blank" action="https://www2.correios.com.br/sistemas/rastreamento/resultado_semcontent.cfm">
<input type="hidden" name="Objetos" value="CODIGODERASTREIO">
<a href="javascript:;" onclick="parentNode.submit();">CODIGODERASTREIO</a>
</form>
<?php
/*
Increase or decrease value in CakePHP with little footprint.
Add this to your AppModel.
Usage:
(in Controller)
$this->Model->increase('field_name', 1);
// Obter identificação do comprador
var getSenderHash = function () {
console.log('getSenderHash >>>');
PagSeguroDirectPayment.onSenderHashReady(function(response) {
if (response.status == 'error') {
console.log(response.message);
return false;
}
console.log(response);
hashField.val(response.senderHash);
@viniciusbig
viniciusbig / deploy.php
Created September 13, 2018 17:37 — forked from sakanaproductions/deploy.php
PHP Deployer Config File for VPS on Dreamhost
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Project name
set('application', '');
// Project repository
set('repository', 'git@bitbucket.org');
@viniciusbig
viniciusbig / dreamhost-php.md
Created August 9, 2018 01:46 — forked from nissicreative/dreamhost-php.md
Update PHP and install Composer on DreamHost

DreamHost PHP

Make PHP 7 default binary for CLI

ssh <server>
@viniciusbig
viniciusbig / gist:722ca4d79150a031e554a2887a8f9677
Created July 31, 2018 22:26 — forked from diegoprates/gist:5047663
Tradução do jQuery validation plugin oara pt-BR. By https://gist.github.com/FernandoVezzali.
/*
* Translated default messages for the jQuery validation plugin.
* Locale: PT_BR
*/
jQuery.extend(jQuery.validator.messages, {
required: "Este campo &eacute; requerido.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
// transform cropper dataURI output to a Blob which Dropzone accepts
function dataURItoBlob(dataURI) {
var byteString = atob(dataURI.split(',')[1]);
var ab = new ArrayBuffer(byteString.length);
var ia = new Uint8Array(ab);
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return new Blob([ab], { type: 'image/jpeg' });
}
@viniciusbig
viniciusbig / gulpfile.js
Created March 29, 2018 13:55 — forked from csrui/gulpfile.js
Generic gulpfile for CakePHP apps. Compiles and minifies sass. Minifies and lints javascript. Generates documentation with yuidoc
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
var rename = require('gulp-rename');
var yuidoc = require("gulp-yuidoc");
@viniciusbig
viniciusbig / trakt-auth.js
Created March 6, 2018 11:05
Trakt TV Node Authentication
// Open a file in disk with promise
const getJson = (filename) => {
return new Promise((resolve, reject) => {
jsonfile.readFile(filename, function(err, obj) {
if (err) { reject(err); }
resolve(obj);
});
});
};