Skip to content

Instantly share code, notes, and snippets.

View MrNyG25's full-sized avatar

MrNyG25 MrNyG25

  • Colombia
View GitHub Profile
/**
*
* WITHOUT NESTING
*/
// An asynchronous function that performs a task on each item
/* async function performAsyncTask(item) {
// Simulating an asynchronous task with a delay
await delay(1000);
console.log(`Task completed for item: ${item}`);
@Klerith
Klerith / dart-snippets.json
Created December 17, 2021 18:40
Flutter Snippets
{
// Place your snippets for dart here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@marco-souza
marco-souza / fileToBase64.ts
Created July 14, 2020 17:15
Convert File to Base64 in JavaScript/TypeScript
export const toBase64 = (file: File) =>
new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = (error) => reject(error);
});
@EntwistleOx
EntwistleOx / .md
Last active October 13, 2024 21:51
QUIZ - PROFESSIONAL SCRUM MASTER CERTIFICATE

SCRUM MASTER PROFESSIONAL CERTIFICATE (SMPC®)

Simulador para examen Scrum Master

1. ¿Quién debe hacer el trabajo requerido para los elementos del Producto Backlog, para crear un Incremento potencialmente liberable?

  1. El equipo Scrum.
  2. El Scrum Master.
  3. El Equipo de Desarrollo.
  4. El Product Owner.

service

@Injectable({
  providedIn: 'root'
})
export class UserService {

  constructor(
    private http: HttpClient
@Roms1383
Roms1383 / validation.pipe.test.ts
Created March 27, 2020 17:09
Medium - Easy validation with Nest.js and Joi
import * as Joi from '@hapi/joi'
import { Body, Controller, Module, NotImplementedException, Post, UsePipes } from '@nestjs/common'
import { NestFactory } from '@nestjs/core'
import axios from 'axios'
import * as Joiful from 'joiful'
import { ValidationPipe } from './validation.pipe'
class Implicit {
@Joiful.string().required()
@iamsajidjaved
iamsajidjaved / AppServiceProvider.php
Created December 12, 2019 07:04 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@axelvnk
axelvnk / OrSearchFilter.php
Last active November 1, 2024 23:08
Api platform OR search filter
<?php
namespace Axelvkn\AppBundle\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Core\Exception\InvalidArgumentException;
use Doctrine\ORM\QueryBuilder;
class OrSearchFilter extends SearchFilter
@jeffochoa
jeffochoa / Response.php
Last active March 11, 2025 20:15
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
// Controller
// Metodo do controle que faz a chacagem
protected function checkRecaptcha($token, $ip)
{
$response = (new Client)->post('https://www.google.com/recaptcha/api/siteverify', [
'form_params' => [
'secret' => config('services.recaptcha.secret'),
'response' => $token,