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
tell application "Finder" | |
set _question to display dialog "Please enter file name..." default answer "" with title "New File" | |
set _file to text returned of _question | |
set _target to target of front window as alias | |
set _path to POSIX path of _target | |
set full_name to quoted form of _path & _file | |
do shell script "touch " & full_name | |
end tell |
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
// Here are some examples of using Javascript for Automation with OmniFocus | |
// Create an inbox task | |
// | |
// Here, we call inboxTasks without parens because we want it as a function to call later | |
of = Application('OmniFocus') | |
inbox = of.defaultDocument.inboxTasks | |
task = of.InboxTask({name: "testing"}) | |
inbox.push(task) |
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 parse(dateToParse) { | |
return chrono.parse(dateToParse) | |
} | |
function parseDate(dateToParse) { | |
return chrono.parseDate(dateToParse) | |
} | |
window = this; |
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 { AnimatePresence, usePresence } from "framer-motion"; | |
import { classNames } from "~/lib/utils/class-names"; | |
import { useCounter } from "@kyleshevlin/use-common"; | |
import { useCallback } from "react"; | |
const Box = ({ count }: { count: number }) => { | |
const [isPresent, safeToRemove] = usePresence(); | |
const onAnimationEnd = useCallback(() => { | |
if (!isPresent) safeToRemove(); |
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
fs.readFile('test.md', {encoding: 'UTF-8'},function (err, data) { | |
if (err) throw err; | |
console.log(data); | |
}); |
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 { useRouteData } from "remix-utils"; | |
import type { SerializeFrom } from "@remix-run/server-runtime"; | |
import type { loader } from "~/root"; | |
export let useRootData = () => | |
useRouteData<SerializeFrom<typeof loader>>("root"); |
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
set -x COMMENT 6272a4 | |
set -x CYAN 8be9fd | |
set -x GREEN 50fa7b | |
set -x ORANGE ffb86c | |
set -x PINK ff79c6 | |
set -x PURPLE bd93f9 | |
set -x RED ff5555 | |
set -x YELLOW f1fa8c | |
set -U fish_color_autosuggestion $COMMENT |
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
" Toggle spellchecking | |
function! ToggleSpellCheck() | |
set spell! | |
if &spell | |
echo "Spellcheck ON" | |
else | |
echo "Spellcheck OFF" | |
endif | |
endfunction |
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
let removeInvalidSearchParams = ( | |
error: unknown, | |
request: Request, | |
prefix = "Unrecognized key(s) in object:" | |
) => { | |
let unrecongnizedKeysSchema = z.tuple([ | |
z.tuple([z.string().length(0), z.string().startsWith(prefix)]), | |
]); | |
let result = unrecongnizedKeysSchema.safeParse(formatError(error)); |
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 { FetcherWithComponents, FormProps } from "@remix-run/react"; | |
import type { ReactElement, ReactNode } from "react"; | |
import { Form } from "@remix-run/react"; | |
import { useHydrated } from "remix-utils"; | |
export let NoJS = ({ children }: { children: ReactElement }) => { | |
let isHydrated = useHydrated(); | |
if (!isHydrated) { |
NewerOlder