@HostBinding('attr.id')
externalId = '';
@Input()
set id(value: string) {
this.#id = value;
this.externalId = null;
}
This file contains 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
// Menu: JA → EN | |
// Description: Translate selected text into with Google Translate. | |
// Author: Brandon Pittman | |
// Shortcut: ctrl j | |
import "@johnlindquist/kit"; | |
const origin = "https://translate.google.com"; | |
const text = await getSelectedText(); | |
const sl = "ja"; |
This file contains 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 clsx from 'clsx'; | |
import { differenceInWeeks } from 'date-fns'; | |
const fillIn = (complete: boolean) => | |
clsx( | |
complete ? 'bg-gray-300' : 'bg-transparent', | |
'h-1.5 w-1.5 border border-gray-300 rounded-full' | |
); | |
const weekCount = differenceInWeeks(new Date(), new Date('8/31/1983')); |
This file contains 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
#!/usr/bin/env node | |
const os = require("os"); | |
if (os.platform() !== "darwin") { | |
console.error("This script only works with macOS."); | |
process.exit(1); | |
} | |
const { spawn } = require("child_process"); |
This file contains 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
await $`mkdir example` | |
await cd('example') |
This file contains 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 "Evernote" | |
set the_notes to selection | |
set the_dialog to display dialog "What would you like to title these notes?" default answer "" | |
set the_title to text returned of the_dialog | |
set the_count to 1 |
This file contains 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 * as React from 'react' | |
import hash from 'fnv1a' | |
export const IconCache = React.createContext({}) | |
IconCache.displayName = 'IconCache' | |
export const useIconCache = () => React.useContext(IconCache) | |
const withIcon = (icon) => { | |
const Icon = (props) => { | |
const { size = 24, color = 'currentColor', ...propsWeDontControl } = props | |
const cache = useIconCache() |
This file contains 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
<?php | |
namespace App\Http\Livewire; | |
use Livewire\Component; | |
class Counter extends Component | |
{ | |
public $count = 0; |
This file contains 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
#!/bin/zsh | |
# If you use #'s for defer and start dates, you'll need to escape the #'s or | |
# quote the whole string. | |
function of () { | |
if [[ $# -eq 0 ]]; then | |
open -a "OmniFocus" | |
else | |
osascript <<EOT |
This file contains 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) |