Skip to content

Instantly share code, notes, and snippets.

View danielebarbaro's full-sized avatar
🎯
Focusing

Daniele Barbaro danielebarbaro

🎯
Focusing
View GitHub Profile
import app from './app.js';
import supertest from 'supertest';
import { faker } from '@faker-js/faker';
import mongoose from "mongoose";
it('Testing to see if Jest works', () => {
expect(true).toBe(true);
});
// it('[GET] - Call /init with success', async () => {
@danielebarbaro
danielebarbaro / Response.php
Created April 9, 2021 09:11 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@danielebarbaro
danielebarbaro / how_to_gen_ssl_cert.md
Created March 23, 2021 05:56 — forked from iansheridan/how_to_gen_ssl_cert.md
How to generate an SSL CSR or self signed SSL certificate

How to generate an SSL CSR or self signed SSL certificate

Overview

The following is an extremely simplified view of how SSL is implemented and what part the certificate plays in the entire process.

Normal web traffic is sent unencrypted over the Internet. That is, anyone with access to the right tools can snoop all of that traffic. Obviously, this can lead to problems, especially where security and privacy is necessary, such as in credit card data and bank transactions. The Secure Socket Layer is used to encrypt the data stream between the web server and the web client (the browser).

SSL makes use of what is known as asymmetric cryptography, commonly referred to as public key cryptography (PKI). With public key cryptography, two keys are created, one public, one private. Anything encrypted with either key can only be decrypted with its corresponding key. Thus if a message or data stream were encrypted with the server's private key, it can be decrypted only using its corresponding public key, ensuring

@danielebarbaro
danielebarbaro / credit-card-regex.md
Created August 28, 2020 12:27 — forked from michaelkeevildown/credit-card-regex.md
Credit Card Regex Patterns

Credit Card Regex

  • Amex Card: ^3[47][0-9]{13}$
  • BCGlobal: ^(6541|6556)[0-9]{12}$
  • Carte Blanche Card: ^389[0-9]{11}$
  • Diners Club Card: ^3(?:0[0-5]|[68][0-9])[0-9]{11}$
  • Discover Card: ^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$
  • Insta Payment Card: ^63[7-9][0-9]{13}$
  • JCB Card: ^(?:2131|1800|35\d{3})\d{11}$
  • KoreanLocalCard: ^9[0-9]{15}$
@danielebarbaro
danielebarbaro / postgres-brew.md
Created April 20, 2020 16:38 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@danielebarbaro
danielebarbaro / git_report.sh
Created March 20, 2020 15:16
A scratch script to count commit days
#!/bin/bash
#Use: report.sh 2020 [email protected]
year=$1
author=$2
with_details=0
git_options=" --oneline --first-parent --reverse --all --branches --date-order --abbrev-commit --date=local --date=short "
for directory in *; do
if [ -d "${directory}" ] && [ -d "${directory}/.git" ]; then
cd $directory
@danielebarbaro
danielebarbaro / iterm2-solarized.md
Created November 7, 2019 16:14 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@danielebarbaro
danielebarbaro / .php_cs
Last active January 21, 2020 11:04
Laravel Standards Checker
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/cache')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
@danielebarbaro
danielebarbaro / gist:638ea6596439244e4ae53b7766f54dfc
Created March 31, 2018 15:09 — forked from ksloan/gist:d1b9ace61fddd2356ebf
CSS Color Definitions for Font-Awesome Social Icons
.fa-facebook, .fa-facebook-square {
color: #3b5998
}
.fa-twitter, .fa-twitter-square {
color: #00aced
}
.fa-google-plus, .fa-google-plus-square {
color: #dd4b39
}
.fa-youtube, .fa-youtube-play, .fa-youtube-square {