Skip to content

Instantly share code, notes, and snippets.

View dealingwith's full-sized avatar

Daniel Miller dealingwith

View GitHub Profile
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": {
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",
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": [
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": [
@dealingwith
dealingwith / shorten-url.js
Created May 4, 2021 04:02
Cuttly URL shortener script for Script Kit
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)
@dealingwith
dealingwith / new-post.js
Last active April 18, 2021 22:53
Create a new Jekyll post with Script Kit
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')
@dealingwith
dealingwith / notion_metadata_toggle.js
Last active December 25, 2020 14:33
Bookmarklet for toggling Notion metadata
javascript:(function(){var metadata = document.querySelector("#notion-app > div > div.notion-cursor-listener > div.notion-frame > div.notion-scroller.vertical.horizontal > div:nth-child(2)"); if (metadata.style.display == "") {metadata.style.display = "none";} else {metadata.style.display = "";} })();
@dealingwith
dealingwith / facebook-stylish-styles
Created March 22, 2020 17:26
facebook-stylish-styles.css
/* hide stories */
#ssrb_stories_start + div {
display: none;
}
* {
font-family: Ubuntu !important;
}
::-webkit-scrollbar {
width: 0px;
height: 0px;
background: transparent;
}
@dealingwith
dealingwith / mbe01-mbe07.java
Last active May 18, 2019 04:26
Showing the diff of a simple Minecraft block and one that drops items
public class BlockDropper extends Block
{
public BlockDropper()
{
super(Material.ROCK);
this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS); // the block will appear on the Blocks tab in creative
this.setHardness(0.5f);
}
@SideOnly(Side.CLIENT)