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 {format} = await npm('date-fns') | |
| let title = await arg('Name of post') | |
| let file_title = title.toLowerCase().replaceAll(' ', '-') | |
| let posts_path = '/Users/danielmiller/code/daniel-industries/_posts/' | |
| let date = new Date() | |
| let date_for_path = format(date, 'yyyy-MM-dd') | |
| let date_for_yml = format(date, 'yyyy-MM-dd hh:mm:ss z') |
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 API_KEY = "[YOURS]" | |
| let url_to_shorten = await arg('Enter URL') | |
| let {data} = await get(`https://cutt.ly/api/api.php?key=${API_KEY}&short=${url_to_shorten}`) | |
| copy(data.url.shortLink) |
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 notionToken = await env('NOTION_USER_TOKEN') | |
| let databaseID = "3859b567fda3464ea5a69d5ccb56274b" | |
| let content = await arg('Enter Task') | |
| let {data} = await post( | |
| 'https://api.notion.com/v1/pages', { | |
| "parent": { "database_id": databaseID }, | |
| "properties": { | |
| "Name": { | |
| "title": [ |
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 notionToken = await env('NOTION_USER_TOKEN') | |
| let databaseID = "3859b567fda3464ea5a69d5ccb56274b" | |
| let content = await arg('Enter Task') | |
| let {data} = await post( | |
| 'https://api.notion.com/v1/pages', { | |
| "parent": { "database_id": databaseID }, | |
| "properties": { | |
| "Name": { | |
| "title": [ |
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 notionToken = await env('NOTION_USER_TOKEN') | |
| let databaseID = "3859b567fda3464ea5a69d5ccb56274b" | |
| let {data} = await post( | |
| `https://api.notion.com/v1/databases/${databaseID}/query`, | |
| { | |
| "filter": { | |
| "and": [ | |
| { | |
| "property": "Status", |
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 notionToken = await env('NOTION_USER_TOKEN') | |
| let databaseID = "3859b567fda3464ea5a69d5ccb56274b" | |
| let {data} = await post( | |
| `https://api.notion.com/v1/databases/${databaseID}/query`, | |
| { | |
| "filter": | |
| { | |
| "property": "Status", | |
| "select": { |
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 { titleCase } = await npm("title-case"); | |
| let { getSelectedText } = await kit("text"); | |
| let selectedText = await getSelectedText(); | |
| let value = titleCase(selectedText); | |
| await setSelectedText(value); |
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 { titleCase } = await npm("title-case"); | |
| let selectedText = await getSelectedText(); | |
| let value = titleCase(selectedText); | |
| await setSelectedText(value); |
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
| body, td, input, textarea, select, div, span { | |
| font-family: -apple-system, system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif !important; | |
| } | |
| .Nm .Nt { | |
| border-left: 0px; | |
| } | |
| .aZ6::-webkit-scrollbar { | |
| width: 0px; |
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 Jimp = await npm('jimp') | |
| let width = await arg('New width in pixels') | |
| let selectedFiles = await getSelectedFile(); | |
| let filePaths = selectedFiles.split("\n"); | |
| for (let filePath of filePaths) { | |
| Jimp.read(filePath, (err, image) => { | |
| if (err) throw err; |