Skip to content

Instantly share code, notes, and snippets.

View marcelino-borges's full-sized avatar

Marcelino Borges marcelino-borges

View GitHub Profile
@josemariagarcia95
josemariagarcia95 / upload-to-ftp.js
Created November 9, 2018 11:13
Code snippet to upload files to FTP server using Node.js
const Ftp = require( 'ftp' );
const ftpClient = new Ftp();
ftpClient.on( 'ready', function() {
ftpClient.put( './prueba.jpg', '/www/img/prueba.jpg', function( err, list ) {
if ( err ) throw err;
ftpClient.end();
} );
} );
@Kobusvdwalt
Kobusvdwalt / index.html
Last active January 31, 2022 22:23
Full Screen template for Unity HTML
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Unity WebGL Player | WebTest</title>
<script src="Build/UnityLoader.js"></script>
<style>
body{
@davidalves1
davidalves1 / formatar_cnpj_cpf.md
Last active October 22, 2024 14:21
Função para formatar CNPJ e CPF, disponível em PHP e JS

PHP

function formatCnpjCpf($value)
{
  $CPF_LENGTH = 11;
  $cnpj_cpf = preg_replace("/\D/", '', $value);
  
  if (strlen($cnpj_cpf) === $CPF_LENGTH) {
    return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
  } 
@ygotthilf
ygotthilf / jwtRS256.sh
Last active November 7, 2024 10:42
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@hootlex
hootlex / laravellocal.md
Last active November 4, 2024 19:00
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci