Skip to content

Instantly share code, notes, and snippets.

View bryandidur's full-sized avatar

Bryan Didur bryandidur

  • Florianópolis, SC - Brazil
View GitHub Profile
@bryandidur
bryandidur / git-basic-commands.md
Last active August 1, 2018 12:59
Git Basic Commands

1) Initialize a GIT repository

cd /path/to/your/project

git init

2) Add files to the 'staging area'

git add `filename.ext` // Add a single file
@bryandidur
bryandidur / animated-text.md
Last active May 27, 2019 03:39
Animated Text Vue Component

Add the Animate CSS library to your project (https://daneden.github.io/animate.css/)

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">

Code

@bryandidur
bryandidur / pulse-button.md
Last active May 27, 2019 15:40
Pulse Button Vue Component

Code

Vue.component('pulse-button', {
    props: {
        text: {
            type: String,
            default: '',
        },
        classes: {
@bryandidur
bryandidur / swipeable.md
Last active June 2, 2019 20:13
Swipe Callback Vue Component

Add the Hammer JS library to your project (https://hammerjs.github.io)

<script src="http://hammerjs.github.io/dist/hammer.min.js"></script>

Code

@bryandidur
bryandidur / laravel-commands-scheduling.md
Last active August 27, 2019 15:54
Examples on how to schedule Laravel commands passing arguments & options

Passing arguments

$schedule->command('namespace:command-name', ['arg1', 'arg2'])->everyMinute();

Passing options

$schedule->command('namespace:command-name', ['--option1', '--option2'])->everyMinute();

Auto scheduling (The command scheduling itself)

@bryandidur
bryandidur / file-input.md
Last active September 16, 2019 20:19
File input validation Vue component
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Client LAB</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
</head>
@bryandidur
bryandidur / model-component.md
Last active September 16, 2019 20:20
Vue model between component
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Client LAB</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
</head>
<body>
@bryandidur
bryandidur / overwriting-terminal-output.md
Last active September 19, 2019 14:29
Overwriting Terminal Output PHP
/**
 * Print a text and overwrite it (on the output) on a next call (terminal use only).
 *
 * @param  string $text
 * @return void
 */
function print_overwriting(string $text): void
{
    static $isFirstCall = true;
@bryandidur
bryandidur / typescript-generics.md
Created February 15, 2020 00:54
Examples of Typescript Generics
/*
|-----------------------------------------------------
| Example 1: basic use of generics
|-----------------------------------------------------
| 'T' represents a dinamyc type passed to the function
|
*/
// function identity<T>(arg: T): T {
//   return arg;