Skip to content

Instantly share code, notes, and snippets.

View vs0uz4's full-sized avatar
🏠
Working from home

Vitor Rodrigues vs0uz4

🏠
Working from home
View GitHub Profile
@vs0uz4
vs0uz4 / docker-compose.yml
Last active April 22, 2022 22:37
docker-compose Sample
version: '3.5'
services:
memcached:
image: 'memcached:alpine'
networks:
- yooble
redis:
image: 'redis:5.0-alpine'
@vs0uz4
vs0uz4 / Dockerfile
Created April 22, 2022 22:31
Dockerfile Sample
FROM php:8.1-fpm-alpine
RUN apk update \
&& apk add ca-certificates wget \
&& update-ca-certificates
COPY --from=composer /usr/bin/composer /usr/bin/
RUN apk add --no-cache mysql-client msmtp perl wget procps shadow libzip libpng libjpeg-turbo libwebp freetype icu
@vs0uz4
vs0uz4 / Dockerfile
Created January 6, 2022 01:36
Example of Dockerfile with MS SQL Server support on PHP
FROM ubuntu:21.04
LABEL maintainer="Taylor Otwell"
ARG WWWGROUP
ARG NODE_VERSION=16
WORKDIR /var/www/html
ENV DEBIAN_FRONTEND noninteractive
{
"folders": [
{
"path": "."
}
],
"settings": {
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#007c27",
"titleBar.activeForeground": "#ffffff",
@vs0uz4
vs0uz4 / docker-compose.yml
Created January 27, 2021 03:10
Gist - Docker Compose Scritp for Laravel 8.0 (MariaDB, Redis, Memcached and Mailhog)
# For more information: https://laravel.com/docs/sail
version: '3'
volumes:
sailredis:
driver: local
sailmariadb:
driver: local
services:
@vs0uz4
vs0uz4 / MovieList.spec.js
Last active May 18, 2020 15:02
renders movie list with 2 movies even when the list contains more movies but only 2 of them contain backdrop_path
import '@testing-library/jest-dom/extend-expect';
import { render, fireEvent, getAllByTestId } from '@testing-library/svelte';
import MovieList from '../components/movies/MovieList';
import { store, INITIAL_STATE } from '../store';
import moviesMock from './mocks/movies.json';
describe("Movie List", () => {
it("renders movie list with 2 movies even when the list contains more movies but only 2 of them contain backdrop_path", () => {
@vs0uz4
vs0uz4 / arquivo.js
Created December 8, 2018 01:03 — forked from tuliofaria/arquivo.js
Trecho de código utilizado no Hands-on React-native do DevPleno
regionFrom = (lat, lon, distance) => {
distance = distance/2
const circumference = 40075
const oneDegreeOfLatitudeInMeters = 111.32 * 1000
const angularDistance = distance/circumference
const latitudeDelta = distance / oneDegreeOfLatitudeInMeters
const longitudeDelta = Math.abs(Math.atan2(
Math.sin(angularDistance)*Math.cos(lat),
Math.cos(angularDistance) - Math.sin(lat) * Math.sin(lat)))
@vs0uz4
vs0uz4 / ranking.js
Created November 28, 2018 23:16
Módulo 'ranking' verifica a existência dos rankings em cache, caso não existam faz a query e salva no cache (redis)
const express = require('express')
const route = express.Router()
const encRedisClient = require('./cache/setup')
const init = connection => {
let classification = null
route.get('/', async (req, res) => {
if (!classification) {
const groupsRanking = await encRedisClient.getAsync('groupsRanking', async (err, reply) => {
@vs0uz4
vs0uz4 / AuthController.php
Created September 9, 2018 06:46
Example Swagger Laravel - Definitions for Response Content
<?php
namespace Backend\Http\Controllers\Api;
use Illuminate\Http\Request;
use Backend\Http\Controllers\Controller;
use Tymon\JWTAuth\Exceptions\JWTException;
class AuthController extends Controller
{
@vs0uz4
vs0uz4 / Activity_SolidGauge.sample
Created May 3, 2018 16:11
HighCharts with ConsoleTVs\Charts (ActivitySolidGauge)
/*
* SolidGaugeChart Class
*/
<?php
namespace App\Charts;
use ConsoleTVs\Charts\Classes\Highcharts\Chart;
class ActivityChart extends Chart