Skip to content

Instantly share code, notes, and snippets.

View ceottaki's full-sized avatar

Felipe Ceotto ceottaki

View GitHub Profile
import { ChangeEvent, SetStateAction } from 'react'
/**
* Creates an event handler for on-change events of form input elements.
* The expectation is that the state being set has properties with the same name as the form elements.
* Form elements needs to have a name set otherwise an error will be thrown.
*
* @template T The type of the state.
* @param {(value: SetStateAction<T>) => void} setState The setState function.
* @returns
@ceottaki
ceottaki / deprecated.js
Created May 18, 2020 14:09
Higher-order React component that marks a component as deprecated.
import React from 'react'
/**
* Higher-order component that marks a React component as deprecated.
*
* @param {*} Component The React component to be marked as deprecated.
* @param {*} message An optional message to be included in the deprecation warning.
* @param {boolean} [strict=false] A flag indicating whether to do a strict deprecation (component will not render) or not (component will render normally).
*/
const deprecated = (Component, message, strict = false) => props => {
@ceottaki
ceottaki / a-big-checkbox-angular-directive-styled-with-font-awesome.markdown
Created January 24, 2017 13:59
A big checkbox angular directive styled with font-awesome

A big checkbox angular directive styled with font-awesome

I have created an angular directive that allows the user to create a big checkbox using FontAwesome unchecked and checked icons and a label while also binding it to an ng-model property.

A Pen by Felipe Ceotto on CodePen.

License.

// ----------------------------------------------------------------------------------------------------------------------------
// <copyright file="SieveOfEratosthenes.cs" company="Felipe Ceotto">Copyright (c) Felipe Ceotto. All rights reserved.</copyright>
//
// This file is a standalone utility and was created as part of an exercise.
//
// Although it is not a 'software' in itself, it is freely provided and you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
@ceottaki
ceottaki / RomanizerUtility.cs
Last active January 4, 2016 16:49
An utility class that handles numbers written in Roman numerals, with methods for converting Hindu-Arabic numbers into Roman numbers and vice-versa.
// ----------------------------------------------------------------------------------------------------------------------------
// <copyright file="RomanizerUtility.cs" company="Felipe Ceotto">Copyright (c) Felipe Ceotto. All rights reserved.</copyright>
//
// This file is a standalone utility and was created as part of an exercise.
//
// Although it is not a 'software' in itself, it is freely provided and you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the