Skip to content

Instantly share code, notes, and snippets.

@mauro-baptista
mauro-baptista / Pagination.Vue
Last active May 15, 2020 23:52
Using Laravel Pagination with IntertiaJS
<template>
<div v-if="hasPages" class="mx-auto mb-4">
<ul>
<li v-if="onFirstPage" class="inline-block p-2 bg-transparent mx-1 rounded text-gray-400">
<span aria-hidden="true">&lsaquo;</span>
</li>
<li v-else class="inline-block p-2 bg-transparent mx-1 rounded text-gray-700">
<inertia-link :href="previousPageUrl" rel="prev">&lsaquo;</inertia-link>
</li>
@mauro-baptista
mauro-baptista / CameraController.cs
Created February 28, 2020 20:32
Camera Controller for Strategy Games [Unity]
/*
* This code was created by the Youtube channel Game Dev Guide
* Please watch this video: https://www.youtube.com/watch?v=rnqF6S7PfFA
*
* Note: It has a couple of small changes, but it should work as the
* code shown on the video.
*/
using UnityEngine;
public class CameraController : MonoBehaviour
@mauro-baptista
mauro-baptista / NumberFormat.php
Last active May 8, 2023 00:22
Easily readable numbers
<?php
/**
* Numbers more readable for humans
*
* It intends to change numbers as 1000 as 1K or 1200000 as 1.2M
*
* This code is heavly base in this one: https://gist.github.com/RadGH/84edff0cc81e6326029c
*
* How to use \NumberFormat::readable(1000);
*/
@mauro-baptista
mauro-baptista / powerlevel9k
Last active January 6, 2018 22:44
Powershell Config (powerlevel9k)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(vcs root_indicator command_execution_time background_jobs time status)
#Font: https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete%20Mono.otf
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_TIME_FORMAT="%D{\uf017 %H:%M \uf073 %d/%m/%y}"
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="%{%F{249}%}\u250f"
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%{%F{249}%}\u2517%{%F{default}%} $ %{%F{255}%}"