Skip to content

Instantly share code, notes, and snippets.

View anubra266's full-sized avatar
💥
Playing vscode...

Abraham anubra266

💥
Playing vscode...
View GitHub Profile
@anubra266
anubra266 / git.md
Created May 3, 2021 22:35
Git Ignore File on a local repo only
git update-index --assume-unchanged ./filePath
curl https://gist.githubusercontent.com/yyx990803/7745157/raw/dbcf4874d55490f3c2af9d593950964fe48b1e31/starcounter.js -sSL | node - anubra266
@anubra266
anubra266 / App.js
Created March 10, 2021 23:21
Page progress scroll in React
import { useState, useEffect } from 'react';
export const ScrollIndicator = () => {
const [scroll, setScroll] = useState(0);
const onScrollProgress = () => {
const scrollPx = document.documentElement.scrollTop;
const winHeightPx =
document.documentElement.scrollHeight -
document.documentElement.clientHeight;
@anubra266
anubra266 / How.md
Created March 1, 2021 03:28
Solve laravel flock error

Check permissions of storage/framework/cache/data just to define 777 to the storage/framework/cache won't be enough, you should also give the webserver user permissions to write into that folder, typically the user is: www-data or _www.

The right thing is to have 775 permissions to this folder then change only the grupo to allow both your user and the webserver user to write into those folders.

Run this in shell

@anubra266
anubra266 / Formy.js
Created February 13, 2021 02:47
React Form handler - Formy
import React, { useState } from "react";
const Formy = (props) => {
const [values, setValues] = useState(props.initialValues);
const fieldProps = Object.keys(values).reduce((acc, nxt) => {
acc = {
...acc,
[nxt]: {
value: values[nxt],
onChange: (e) => {
@anubra266
anubra266 / CONTRIBUTING.md
Last active January 22, 2021 02:19
Model Readme and contributing md

Contributing

Write something nice and instructive as an intro. Talk about what kind of contributions you are interested in.

Welcome! We love receiving contributions from our community, so thanks for stopping by! There are many ways to contribute, including submitting bug reports, improving documentation, submitting feature requests, reviewing new submissions, or contributing code that can be incorporated into the project.

This document describes our development process. Following these guidelines shows that you respect the time and effort of the developers managing this project. In return, you will be shown respect in addressing your issue, reviewing your changes, and incorporating your contributions.

If you're not looking for some kinds of contributions, note that up front:

@anubra266
anubra266 / Readme.md
Created January 13, 2021 23:35
Use Variables in JSON Files

Use Variables in JSON Files

Long Story Short;

Visit Here

@anubra266
anubra266 / Readme.md
Last active January 13, 2021 16:31
Load any file as Text

Load any file as Text

First, install raw-loader:

npm i -D raw-loader

Second, add the loader to your webpack config, for file extensions to load:

// webpack.config.js
@anubra266
anubra266 / CustomAttemptToAuthenticate.php
Created January 10, 2021 23:33
Custom Fortify Login
<?php
namespace App\Actions\Auth;
use Laravel\Fortify\Actions\AttemptToAuthenticate;
use Laravel\Fortify\Fortify;
class CustomAttemptToAuthenticate extends AttemptToAuthenticate
{
@anubra266
anubra266 / Readme.md
Last active February 11, 2024 00:13
Laravel Queue Email Verify and Password Reset Mails

Laravel Queue Email Verify and Password Reset Mails

First step is to overwrite the default methods in your User Model.

NB: We are still using the default Laravel Notifications.

# App/Models/User.php

php