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
| on run argv | |
| set bundleID to (system attribute "alfred_workflow_bundleid") | |
| set value to item 1 of argv | |
| set otherValue to item 2 of argv | |
| tell application id "com.runningwithcrayons.Alfred" | |
| set configuration "CONFIG_ITEM_1" to value value in workflow bundleID | |
| set configuration "CONFIG_ITEM_2" to value otherValue in workflow bundleID | |
| end tell | |
| end run |
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 leaves = app.workspace.getLeavesOfType("markdown") | |
| for (const leaf of leaves) { | |
| leaf.detach() | |
| } | |
| const dayFolder = "00 - Daily" | |
| const weeklyFilename = "Week " + tp.date.now("w YYYY") + ".md" | |
| const dailyFilename = tp.date.now("ddd MMM D, YYYY") + ".md" | |
| const weeklyExists = await tp.file.exists(dayFolder + "/" + weeklyFilename) |
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 fs = require("fs").promises; | |
| const path = require("path"); | |
| const TOKEN_PATH = "path to google token files"; | |
| async function calendar() { | |
| try { | |
| const files = await fs.readdir(TOKEN_PATH); | |
| const tokenFiles = files.filter((file) => file.endsWith(".json")); |
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
| Mix.install([:httpoison, :poison]) | |
| defmodule Spotify do | |
| [playlist_id] = System.argv() | |
| @token_url "https://accounts.spotify.com/api/token" | |
| @playlist_url "https://api.spotify.com/v1/playlists/#{playlist_id}" | |
| def get_token() do | |
| client_id = System.get_env("SPOTIFY_CLIENT_ID") |
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 { useRef } from 'react'; | |
| enum ExampleEnum { | |
| One = 'One', | |
| Two = 'Two', | |
| Three = 'Three', | |
| } | |
| export function ExampleComponent(props) { | |
| const itemsRef = useRef<Map<ExampleEnum, HTMLDivElement>>(null); |
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
| #!/usr/bin/env zsh | |
| command=$(git push 2>&1) | |
| result=$(echo $command | grep -Eo '(http|https)://[a-zA-Z0-9./?=_%:-]*' | tr -d '\n') | |
| open -a Arc $result; |
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
| #!/usr/bin/env zsh | |
| # - mr "title" "description" | |
| # https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html | |
| username='YOUR_USERNAME_HERE' | |
| mrq='-o merge_request' | |
| branch=$(git branch --show-current) | |
| linearName=("${(@s/-/)branch}") | |
| result=$(git push -u 2>&1 $mrq.create $mrq.target="master" $mrq.draft $mrq.title="[${linearName[1]:u}-${linearName[2]}] $1" $mrq.assign=$username) | |
| parsed=$(echo $result | grep -Eo '(http|https)://[a-zA-Z0-9./?=_%:-]*' | tr -d '\n') |