Skip to content

Instantly share code, notes, and snippets.

View MrNyG25's full-sized avatar

MrNyG25 MrNyG25

  • Colombia
View GitHub Profile
@ainsofs
ainsofs / gist:2b80771a5582b7528d9e
Created April 16, 2015 01:50
Clear .gitignore cache
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@ben-albon
ben-albon / php5.6-pgsql.Dockerfile
Last active October 4, 2024 08:30
Docker PHP Image with PostgreSQL Driver
FROM php:5.6-apache
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql
COPY src/ /var/www/html
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active April 17, 2025 07:26
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
<template>
<div>
</div>
</template>
<script>
/**
* base: https://github.com/finpo/vue2-recaptcha-invisible
*global window document
*/
// 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,
@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;
@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
@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()
@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()

service

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

  constructor(
    private http: HttpClient