Skip to content

Instantly share code, notes, and snippets.

Vinícius Feitosa da Silva vinnyfs89

Block or report user

Report or block vinnyfs89

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vinnyfs89
vinnyfs89 / Docker Compose (docker-compose) auto scale.md
Created Nov 11, 2019
Docker Compose (docker-compose) auto scale.md
View Docker Compose (docker-compose) auto scale.md

Docker Compose (docker-compose) auto scale

To specify how many containers to scale using docker-compose use the --scale service = {number} command. This command sets 5 containers for redis-service: docker-compose up -d --scale redis-service = 5

docker-compose -f docker-compose-scale.yml up -d --scale hello=5
@vinnyfs89
vinnyfs89 / Git - Bypass proxy to specific host.md
Last active Nov 7, 2019
Git - Bypass proxy to specific host.md
View Git - Bypass proxy to specific host.md
  • Global
$ git config --global add remote.{remote_name} proxy 
  • Locally
$ git config --local --add remote.{remote_name}.proxy ""

Thanks Odilon

View SCP - copy host to client.md

SCP - copy host to client

scp -r user@host:/host/dir/ /my/local/folder

View gist:760aa2e1bfd7d70592c003694a711a8d
scp user@host:'/home/dir/*.{jpg,pdf}' /my/destination/local/folder
@vinnyfs89
vinnyfs89 / Javascript execute callback.md
Created Oct 16, 2019
Javascript execute callback.md
View Javascript execute callback.md
function Thing(name) {
    this.name = name;
}
Thing.prototype.doSomething = function(callback) {
    callback.call(this);
}

function foo() {
    alert(this.name);
@vinnyfs89
vinnyfs89 / vue 2 - Adding a new property to reactive object
Last active Oct 16, 2019
vue 2 - Adding a new property to reactive object
@vinnyfs89
vinnyfs89 / javascript validation group.md
Created Oct 14, 2019
javascript validation group.md
View javascript validation group.md

let conditionsArray = [ condition1, condition2, condition3, ]

if (conditionsArray.indexOf(false) === -1) { "do somthing" }

@vinnyfs89
vinnyfs89 / Oliver Steele’s Nested Object Access Pattern
Created Oct 14, 2019
Oliver Steele’s Nested Object Access Pattern.md
View Oliver Steele’s Nested Object Access Pattern
Oliver Steele’s Nested Object Access Pattern
const name = ((user || {}).personalInfo || {}).name;
@vinnyfs89
vinnyfs89 / readme.md
Created Oct 3, 2019
Download files with AJAX (axios) + laravel + filename
View readme.md

Javascript:

export const getFile = (coArquivo, config = { responseType: 'blob' }) => instance.get(`/upload/${coArquivo}`, config)
  .then((response) => {
    const { headers } = response;
    const dadosFilename = headers['content-disposition'].split('filename=');
    const filename = dadosFilename[1];
  
    const url = window.URL.createObjectURL(new Blob([response.data]));
@vinnyfs89
vinnyfs89 / default.conf
Created Aug 8, 2019 — forked from szarapka/default.conf
NGiNX Configuration for Vue-Router in HTML5 Mode
View default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
You can’t perform that action at this time.