Skip to content

Instantly share code, notes, and snippets.

View guiliredu's full-sized avatar
🚀
Working

Guilherme Dias Redü guiliredu

🚀
Working
View GitHub Profile
@guiliredu
guiliredu / 0_NestJS-Cheatsheet.md
Last active June 8, 2026 03:36
Nest.js Cheatsheet

Nest.js Cheatsheet

Nest CLI

  • npm i -g @nestjs/cli

Packages

  • yarn add class-validator class-transformer
  • yarn add @nestjs/mapped-types
@guiliredu
guiliredu / facebook-page-invite.js
Last active March 16, 2026 02:40
Facebook - Script to auto invite people who liked a page post do like the page
var buttons;
buttons = document.getElementsByClassName('_42ft');
for (var i = 0; i < buttons.length; i++) {
if(buttons[i].getAttribute('ajaxify') != null){
if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){
buttons[i].click();
}
}
}
@guiliredu
guiliredu / feriados-brasileiros-em-php.php
Last active January 1, 2025 02:19
Retorna um array com todos os feriados brasileiros
<?php
function dias_feriados($ano = null)
{
if (empty($ano)) {
$ano = intval(date('Y'));
}
$pascoa = easter_date($ano); // Limite de 1970 ou após 2037 da easter_date PHP consulta http://www.php.net/manual/pt_BR/function.easter-date.php
$dia_pascoa = date('j', $pascoa);
@guiliredu
guiliredu / pagseguro-assinatura.php
Last active November 13, 2024 19:07
Exemplo de pagamento e assinatura pelo PagSeguro com PHP e CURL
<?php
$url = 'https://ws.pagseguro.uol.com.br/v2/pre-approvals/request';
$data['email'] = 'email_vendedor@gmail.com';
$data['token'] = 'TOKEN';
$data['currency'] = 'BRL';
$data['reference'] = $id_cliente;
$data['senderName'] = $cliente['nome'];
@guiliredu
guiliredu / PHPDocExample.php
Last active June 15, 2024 23:33
Example of a PHP Class with Doc Block annotation
<?php
/**
* This class acts as an example on where to position a DocBlock.
*
* A blank line must be place after each paragraph. A title and a description
* can be add. Multiple paragraph descriptions can be used.
*
* @see https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md
* @see http://docs.phpdoc.org/guides/docblocks.html#list-of-tags
@guiliredu
guiliredu / vue-3-composition-api-example.vue
Created June 11, 2024 23:59
Vue 3 Composition API example
<template>
<div
@click="$emit('created')"
>
</div>
</template>
<script setup>
// Imports from VUE
import { onMounted, ref, defineProps, defineEmits, computed } from 'vue';

progrium/bashstyle

Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne

@guiliredu
guiliredu / update-git.sh
Created October 4, 2021 23:03 — forked from YuMS/update-git.sh
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@guiliredu
guiliredu / .editorconfig
Created March 7, 2019 23:25
Editorconfig for PHP PSR-4
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# All PHP files MUST use the Unix LF (linefeed) line ending.
# Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting.
# All PHP files MUST end with a single blank line.
# There MUST NOT be trailing whitespace at the end of non-blank lines.
[*]
@guiliredu
guiliredu / Express.md
Last active March 13, 2020 21:09
Express - Node Backend Studies

Express.js

Installing

$ npm install express --save

Hello World

// index.js