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 / 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/
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;

Adding SFTP-only user to Ubuntu Server

To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo if you're logged in as root.

Directions

  1. Edit /etc/ssh/sshd_config and make sure to add the following at the end of the file:

     Match group filetransfer
    

ChrootDirectory %h