This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // include node fs module | |
| const fs = require('fs'); | |
| const { writeFile, mkdir } = fs; | |
| const makeComponentBoilerPlayer = async (args) => { | |
| const [,, name, filepath] = args; | |
| const directoryName = `${filepath}${name}` | |
| await mkdir(directoryName, () => null); | |
| const componentFileName = `${filepath}${name}.tsx`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // dummy data | |
| const peopleArray = ['Alice', 'Chris', 'Tom Hanks', 'Edgar', 'John']; | |
| // dummy relations | |
| const hardcodedRelations = { | |
| 'Chris': { | |
| 'John:': true, | |
| 'Tom Hanks': true, | |
| }, | |
| 'John': { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @example A hook for setting Error Messages | |
| * import 'hooks/useError'; | |
| * | |
| * @param {String} defaultErrorMessage | |
| */ | |
| export default (defaultErrors = []) => { | |
| const [errors, setError] = useState(defaultErrors); | |
| const raiseError = message => setError([...errors, message]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I don't have serious projects on public repos. : (. | |
| Here's one of the simple illustrative examples I've written for a React meet up I host: | |
| https://github.com/chunkzer/react-cafe-memory-game | |
| https://www.meetup.com/React-Cafe/ | |
| I usually stream code alongs @ https://www.twitch.tv/chunkzer/videos | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Data.List.Split | |
| import Data.List | |
| import Data.Char | |
| subAbc = ([" "] ++ [" "] ++ splitEvery 3 ['A'..'O']) ++ [['P'..'S']] ++ [['T'..'V']] ++ [['W'..'Z']] | |
| indexmap a = map (findIndices (==a)) subAbc | |
| finder a = (findIndices (not . null) (indexmap a) !! 0 , (concat (indexmap a))!!0) | |
| codificador x = map (intToDigit) (replicate ((snd x)+1) (((fst x)))) | |
| espacios [] = [] | |
| espacios (x:y:xs) = if (x!!0 == y!!0) then x:" ":espacios(y:xs) else x:espacios(y:xs) | |
| espacios [x] = x:[] |