Skip to content

Instantly share code, notes, and snippets.

View vinicius73's full-sized avatar
🤓
"Those who cannot acknowledge themselves, will eventually fail."

Vinicius Reis vinicius73

🤓
"Those who cannot acknowledge themselves, will eventually fail."
View GitHub Profile
@vinicius73
vinicius73 / nginx.conf
Last active August 26, 2022 23:51
Example of Nginx Front and API
upstream api {
server 127.0.0.1:3000 max_fails=0;
}
server {
listen 80;
listen [::]:80;
server_name dominio-aqui;
@vinicius73
vinicius73 / Facade.php
Created May 22, 2015 21:30
Facade.php
<?php
/**
* Handle dynamic, static calls to the object.
*/
public static function __callStatic($method, $args)
{
$instance = static::getFacadeRoot();
switch (count($args))
{
const appName = 'App Web'
const companyName = 'D6'
const version = '1.0.0'
const hasSw = (navigator.serviceWorker && navigator.serviceWorker.controller)
const mode = (window.matchMedia('(display-mode: standalone)').matches)
? 'standalone'
: 'web'
const sw = hasSw
? 'sw-on'
server {
listen 80;
listen [::]:80;
server_name api.x.app;
rewrite_log on;
# security
# include shared.d/security.conf;
@vinicius73
vinicius73 / .prettierignore
Last active May 23, 2022 14:51
prettierrc
.vscode/
.yarn/
dist/
coverage/
public/
@vinicius73
vinicius73 / .eslintignore
Created April 20, 2022 14:53
Eslint + Prettier + Vue v2
/.yarn/**
/dist/**
/node_modules/**
@vinicius73
vinicius73 / acm.tf
Created March 5, 2022 13:55
Terraform + Cloudfront Static file CDN
# https://docs.aws.amazon.com/pt_br/acm/latest/userguide/acm-regions.html
resource "aws_acm_certificate" "this" {
provider = aws.virginia # need to be created at virginia (cloudfront bizarre)
domain_name = local.host
subject_alternative_names = local.alias
validation_method = "DNS"
lifecycle {
create_before_destroy = true
@vinicius73
vinicius73 / .dockerignore
Last active February 22, 2022 14:42
Vue Caddy server
node_modules
dist
infra
.tmp
# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
const dic = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
const randomInt = (max = 1000, min = 0) => Math.floor(Math.random() * (max - min)) + min
const randomString = () => dic.charAt(randomInt(dic.length -1, 0))
const makeArray = (length, cb) => Array.from({ length }, cb)
const makeArrayOfStrings = length => makeArray(length, randomString)
const joiArr = lists => lists
.reduce((acc, arr) => {
return `${acc}${arr.join('')}`
}, '')
@vinicius73
vinicius73 / chart.vue
Last active August 17, 2021 08:40
Vue.js + C3.js
<script>
import c3 from 'c3'
import { debounce, cloneDeep, defaultsDeep } from 'lodash'
export default {
name: 'c3-chart',
props: {
config: {
type: Object,
default: () => ({})