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 date = new Date(Date.now()); | |
| const dateTimeFormat = new Intl.DateTimeFormat('ar-sa', { | |
| dateStyle: 'full', | |
| timeStyle: 'full', | |
| calendar: 'islamic-umalqura', | |
| numberingSystem: 'arab', | |
| timeZone: 'Asia/Riyadh', | |
| hour12: true, | |
| }).format(date); |
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
| // TODO: make `pages` optional and measure the div when unspecified, this will | |
| // allow more normal document flow and make it easier to do both mobile and | |
| // desktop. | |
| import { | |
| createContext, | |
| useCallback, | |
| useContext, | |
| useEffect, | |
| useMemo, | |
| useRef, |
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 type { LoaderFunction, ActionFunction } from "remix"; | |
| import { useLoaderData, useFetcher } from "remix"; | |
| import invariant from "tiny-invariant"; | |
| import cuid from "cuid"; | |
| import React from "react"; | |
| import type { Task, User } from "@prisma/client"; | |
| import { requireAuthSession } from "~/util/magic-auth"; | |
| import { ensureUserAccount } from "~/util/account"; | |
| import { placeCaretAtEnd } from "~/components/range"; | |
| import { getBacklog } from "~/models/backlog"; |
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 downloadFile(data, name='myData.tx') { | |
| const blob = new Blob([data], {type: 'octet-stream'}); | |
| const href = URL.createObjectURL(blob); | |
| const a = Object.assign(document.createElement('a'), { | |
| href, | |
| download: name, | |
| }); | |
| document.body.appendChild(a); |
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
| //////////////////////////////////////////////////////////////////////////////// | |
| // Create a directory called "pages" next to | |
| // this file, put markdown files in there, and | |
| // then run: | |
| // | |
| // ``` | |
| // $ node build.mjs | |
| // ``` | |
| // | |
| // Then deploy the "build" directory somewhere. |
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 Discord = require('discord.js') | |
| // your bot token | |
| const token = 'NzM4MDk2NjA4NDQwNDgzODcw.XyG8CA.RbwIBFnAbrRDYOlTdLYgG_T4CMk' | |
| const discordUsername = 'example#1234' | |
| const roleToAdd = 'Cool Person' | |
| const guildName = 'Your Guild Name' | |
| function deferred() { | |
| let resolve, reject |
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 styled, { keyframes } from 'styled-components'; | |
| const move = keyframes` | |
| from { | |
| transform: translateX(0) rotate(0); | |
| } | |
| to { | |
| transform: translateX(100%) rotate(45deg); | |
| } |
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 styled from 'styled-components'; | |
| const people = ['ibrahim', 'mohmaed', 'malak', 'moatz']; | |
| const Person = styled.li` | |
| font-family: Arial, Helvetica, sans-serif; | |
| color: gray; | |
| text-align: center; | |
| ${props => |
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 styled from 'styled-components'; | |
| import Button from '@material-ui/core/Button'; | |
| const Btn = styled(Button)` | |
| padding: 8px 12px; | |
| width: 30%; | |
| height: 50px; | |
| `; | |
| const StyleComponent = () => { |
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 { createGlobalStyle } from 'styled-components'; | |
| const Global = createGlobalStyle` | |
| body { | |
| margin: 0; | |
| color: white; | |
| background: #15202B; | |
| text-align: center; | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', |
NewerOlder