Skip to content

Instantly share code, notes, and snippets.

View rodrigojt's full-sized avatar
🏠
Working from home

Rodrigo Teixeira rodrigojt

🏠
Working from home
View GitHub Profile
@rodrigojt
rodrigojt / Vee Validate - Validating Child components
Created February 15, 2023 19:24 — forked from Danilo-Araujo-Silva/Vee Validate - Validating Child components
A strategy to validate child components with Vue and Vee Validate.
// Somewhere in the initialization:
import VeeValidate from "vee-validate";
Vue.use(VeeValidate);
// Then, in the parent component:
export default {
provide () {
return { parentValidator: this.$validator }
},
@rodrigojt
rodrigojt / Dockerfile
Created October 25, 2019 15:35 — forked from B-Galati/Dockerfile
Dockerfile oracle oci8
FROM php:5.4-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libicu-dev \
libmysqlclient18 \
libc6 \
@rodrigojt
rodrigojt / nginxproxy.md
Created August 3, 2019 18:32 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@rodrigojt
rodrigojt / git-aware-bash-prompt.md
Created October 25, 2017 17:10 — forked from eliotsykes/git-aware-bash-prompt.md
Git Aware Bash Prompt
@rodrigojt
rodrigojt / card.js
Created July 11, 2017 17:18 — forked from tmlbl/card.js
A Simple OOP-Type Object and Mocha Test
var Card = function (suit, rank) {
function constructor () { }
constructor.prototype.getSuit = function () {
return suit;
};
constructor.prototype.setSuit = function (s) {
suit = s;
};
constructor.prototype.getRank = function () {
return rank;
@rodrigojt
rodrigojt / custom_functions.php
Last active January 20, 2016 16:45
Custom functions
<?php
/**
* Automatically add files before PHP document.
* auto_prepend_file = custom_functions.php
*/
function kill() {
$backtrace = debug_backtrace();
$backtrace = current($backtrace);
echo '# ' . $backtrace['file'] . ' ' . $backtrace['line'];
echo '<hr>';
@rodrigojt
rodrigojt / README.md
Created October 12, 2015 06:18 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@rodrigojt
rodrigojt / debug-wp-head.php
Created January 28, 2015 19:57
Debug da função wp_head
// Chamar a função de debug do wp_head
add_action('wp_head', 'debug_scripts_queued');
function debug_scripts_queued() {
global $wp_scripts;
echo '<!--- SCRIPTS QUEUED'."\r\n";
foreach ( $wp_scripts->queue as $script ) {
echo "\r\nSCRIPT: ".$script."\r\n";
$deps = $wp_scripts->registered[$script]->deps;
if ($deps) {
echo "DEPENDENCIES: ";
@rodrigojt
rodrigojt / lista.txt
Last active August 29, 2015 14:11
Brackets Extensions
[PHP-SIG] PHP SmartHints https://github.com/mackenza/Brackets-PHP-SmartHints
Brackets Bookmarks https://github.com/toshsharma/brackets-bookmarks
Brackets Builder https://github.com/vhornets/brackets-builder
Brackets Git https://github.com/zaggino/brackets-git
Brackets Snippets https://github.com/jrowny/brackets-snippets
Code Folding https://github.com/thehogfather/brackets-code-folding
Display Shortcuts https://github.com/redmunds/brackets-display-shortcuts
eqFTP https://github.com/Equals182/eqFTP
FuncDocr https://github.com/wikunia/brackets-funcdocr
Gist Manager https://github.com/FezVrasta/gist-manager
jQuery.validator.addMethod("cnpj", function (cnpj, element) {
cnpj = jQuery.trim(cnpj);
// DEIXA APENAS OS NÚMEROS
cnpj = cnpj.replace('/', '');
cnpj = cnpj.replace('.', '');
cnpj = cnpj.replace('.', '');
cnpj = cnpj.replace('-', '');
var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais;