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
| <div class="flex"> | |
| <aside class="h-screen sticky top-0"> | |
| // Fixed Sidebar | |
| </aside> | |
| <main> | |
| // Content | |
| </main> | |
| </div> |
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
| const dataItems = [{ | |
| title: "title1", | |
| content: [{ | |
| imageUrl: "http://placehold.it/300x300", | |
| title: "Campaigns", | |
| description: "Short description explaining the use of this design in a single sentence." | |
| }, | |
| { | |
| imageUrl: "http://placehold.it/300x300", | |
| title: "Events", |
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
| =ARRAYFORMULA(ROW(A1:A)) | |
| =ARRAYFORMULA(ROW(A2:A)-1) |
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 React from "react"; | |
| import useSWR from 'swr'; | |
| const Index = () => { | |
| const url = 'https://...'; | |
| const fetcher = (...args) => fetch(...args).then(res => res.json()); | |
| const { data, error } = useSWR(url, fetcher) | |
| if (error) return <div>failed to load</div>; | |
| if (!data) return <div>loading...</div>; |
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
| Become a Command-Line Ninja with These Shortcuts | |
| I’ve often found myself in such a frustrating situation, where I have to replace one keyword in the middle of a looong shell command that I just copied and pasted into the terminal (from StackOverflow or course 😅). Jumping over words with Alt-Arrow doesn’t work on all machines; how many left arrows and backspaces do I have to press, in order to replace that path/to/file or username in that genius command I stole from that SO answer?? | |
| Finally, I sat myself down to do some research on how to properly practice Ninjutsu in the terminal. As it turns out, roaming inside that command line environment is not that difficult at all! | |
| I’m primarily a Z-Shell user, so this article will be more focused on ZSH. The shortcuts we are going to see here, however, should mostly work in BASH as well (sorry I don’t use FISH or other shells ). | |
| Fun fact: shell key bindings actually defaults to “emacs mode”! You may have already discovered this if you are an emacs user. But for us m |
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
| {(this.props.items || []).map(({ image, id }) => { | |
| if (!image || !image.medium) { | |
| return null | |
| } | |
| return ( | |
| <li key={id}>{image.medium}</li> | |
| ) | |
| })} |
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
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
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
| // as={`/p/${slugify(tvMazeData.name, { | |
| // lower: true, | |
| // remove: /[*+~.()'"!:@]/g | |
| // })}`} |
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
| function slugify(str) { | |
| return str.toLowerCase(). | |
| replace(/&/g, 'and'). | |
| replace(/[^a-z0-9']+/g, '-'). | |
| replace(/^-|-$/g, ''); | |
| } |
NewerOlder