Skip to content

Instantly share code, notes, and snippets.

@coder054
coder054 / vimrc
Created May 23, 2022 04:08 — forked from Apsu/vimrc
Colemak DHm vim remap
noremap f e
noremap p r
noremap b t
noremap j y
noremap l u
noremap u i
noremap y o
noremap ' p
noremap r s
noremap s d
@coder054
coder054 / axios-401-response-interceptor.js
Created August 18, 2022 02:49 — forked from yajra/axios-401-response-interceptor.js
Axios 401 response interceptor.
// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,
@coder054
coder054 / words.erl
Created September 19, 2022 10:06 — forked from iain17/words.erl
Write a function that uses recursion to return the number of words in a string.
-module(words).
-export([strlen/1]).
%Assignment: Write a function that uses recursion to return the number of words in a string.
% If we send an empty list, return 0.
strlen([]) -> 0;
%Entry point for this module
strlen(Sentence) -> count(Sentence, 1).
%Base case. When its finally empty return the sum count.
count([], Count) -> Count;
@coder054
coder054 / ConsCarCdr.js
Created February 6, 2023 07:58 — forked from scotthaleen/ConsCarCdr.js
JavaScript implementation of cons, car and cdr
function cons(x, y) {
return function(w) { return w(x, y) };
};
function car(z) {
return z(function(x, y) { return x });
};
function cdr(z) {
return z(function(x, y) { return y });
/**
* DERIVING THE Y COMBINATOR IN 7 EASY STEPS
*
* Ionut G. Stan | ionut.g.stan@gmail.com | http://igstan.ro | http://twitter.com/igstan
*
*
* The Y combinator is a method of implementing recursion in a programming
* language that does not support it natively (actually, it's used more for
* exercising programming brains). The requirement is the language to support
* anonymous functions.
@coder054
coder054 / cypress_test_404_spec.js
Created July 6, 2023 04:05 — forked from paulmwatson/cypress_test_404_spec.js
Testing a 404 page with Cypress
cy.visit('/404')
//=> Test fails
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes but does not test the HTTP code was 404
cy.request({url: '/404', failOnStatusCode: false}).its('status').should('equal', 404)
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes, tests that the HTTP code was 404, and tests page was visited
@coder054
coder054 / spleeter.md
Created September 12, 2023 08:11 — forked from dungsaga/spleeter.md
Voice removal AKA karaoke creator
@coder054
coder054 / downshift-example.js
Created October 9, 2023 04:43 — forked from JofArnold/downshift-example.js
Example of how to use Downshift as a controlled component with arbitrary items
// Untested code, but hopefully it gives you an idea.
// Ping me @jofarnold on Twitter if you get stuck
import React, { Component } from "react";
import Downshift from "downshift";
import PropTypes from "prop-types";
function nodeFromItem(id, items) {
return items.find(({ uuid }) => uuid === id);
}
@coder054
coder054 / README.md
Created October 26, 2023 02:45 — forked from tannerlinsley/README.md
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...