Skip to content

Instantly share code, notes, and snippets.

@maurobaptista
maurobaptista / Pagination.Vue
Last active May 15, 2020
Using Laravel Pagination with IntertiaJS
View Pagination.Vue
<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>
@maurobaptista
maurobaptista / CameraController.cs
Created Feb 28, 2020
Camera Controller for Strategy Games [Unity]
View CameraController.cs
/*
* 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
@maurobaptista
maurobaptista / NumberFormat.php
Last active Jan 7, 2021
Easily readable numbers
View NumberFormat.php
<?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);
*/
@maurobaptista
maurobaptista / powerlevel9k
Last active Jan 6, 2018
Powershell Config (powerlevel9k)
View 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}%}"