Skip to content

Instantly share code, notes, and snippets.

View uF4No's full-sized avatar

Antonio uF4No

View GitHub Profile
@uF4No
uF4No / contact.blade.php
Created February 10, 2019 11:06
Laravel blade contact form with reCaptcha
<form action="{{route('contact.send')}}" class="mb-3" method="post" enctype="multipart/form-data">
{!! csrf_field() !!}
<div class="form-row">
<div class="form-group col-md-5">
<label for="name" class="control-label">Name</label>
<input name="name" class="form-control" type="text" id="name" value="{{old('name')}}">
</div>
<div class="form-group col-md-7">
<label for="email" class="control-label">Email</label>
<input name="email" class="form-control" type="email" id="email" value="{{old('email')}}">
@uF4No
uF4No / contact.blade.php
Created February 10, 2019 11:09
Laravel blade contact form without reCaptcha
<form action="{{route('contact.send')}}" class="mb-3" method="post" enctype="multipart/form-data">
{!! csrf_field() !!}
<div class="form-row">
<div class="form-group col-md-5">
<label for="name" class="control-label">Name</label>
<input name="name" class="form-control" type="text" id="name" value="{{old('name')}}">
</div>
<div class="form-group col-md-7">
<label for="email" class="control-label">Email</label>
<input name="email" class="form-control" type="email" id="email" value="{{old('email')}}">
// MessageController.php
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
@uF4No
uF4No / googleAuth.js
Created May 4, 2019 17:47
exports function to generate an authenticated OAuth2 client for Google APIs
/**
* googleAuth.js
*
* Generates an OAuthClient to be used by an API service
* Requires path to file that contains clientId/clientSecret and scopes
*/
const {google} = require('googleapis');
const fs = require('fs');
@uF4No
uF4No / calendarService.js
Created May 4, 2019 18:13
Methods to interact with the Google Calendar API
/**
* calendarService.js
*
* Methods to interact with the Google Calendar API
*
*/
const {google} = require('googleapis');
const debug = require('debug')('gcal:calendarService')
/**
@uF4No
uF4No / index.html
Created October 26, 2019 11:33
socket.io chat client html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- Loads socket.io client from server -->
<!-- <script src="/socket.io/socket.io.js"></script> -->
@uF4No
uF4No / SubscribeForm.vue
Created December 14, 2019 12:23
A Vue.js subscribe form using Vuetify
<template>
<section id="subscribe" class="bg-white">
<v-container>
<v-row row wrap>
<v-col sm="10" offset-sm="1" md="8" offset-md="2">
<h2 class="display-2 text-center mb-3">Do you want to know more?</h2>
<p class="subheading text-center">
Subscribe to receive updates about the project and be one of the firsts to access!
</p>
'use strict'
// To use AWS secrets
//const AWS = require('aws-sdk');
const MongoClient = require('mongodb').MongoClient
//Performance optimization Step 1: declare the database connection object outside
//the handler method so it's cached
let cachedDb = null
{"version":1,"resource":"file:///Users/antonio/Projects/Golang/webserver/main.go","entries":[{"id":"16Pv.go","timestamp":1655909033736},{"id":"PaA1.go","timestamp":1655909065055},{"id":"YuRI.go","timestamp":1655909287786},{"id":"W3b7.go","timestamp":1655909317411},{"id":"nHEJ.go","timestamp":1655909337878}]}
@uF4No
uF4No / ethers-provider-fallback.js
Created March 17, 2022 12:03
how to use multiple RPC endpoints with ethers to reconnect on error
const { ethers } = require('ethers')
const endpoints = [
// main rpc endpoint
'http://localhost:8545',
// fallback one
'https://fallback-rpc-endpoint/12345',
// fallback two
'https://another-fallback-rpc-endpoint/12345',
]