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
goToDraft () { | |
this.draft = response.data.draft | |
if (draft.status === 'OK') { | |
this.$router.push('/') | |
} | |
} |
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
direction = "downright" | |
animate = false | |
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "M", function() | |
animate = not animate | |
window = hs.window.focusedWindow() | |
width = hs.screen.primaryScreen():fullFrame().w | |
height = hs.screen.primaryScreen():fullFrame().h | |
hs.timer.doWhile(function() return animate end, function() | |
frame = window:frame() | |
if direction == "downright" then |
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
-- assign the main screen to a variable | |
s = hs.screen.mainScreen() | |
-- this command will tell you the pixels that you have to work with in your slice and dic | |
s:fullFrame() | |
-- hs.geometry.rect(0.0,0.0,3840.0,2160.0) | |
-- the name of the monitor; comes in handy later | |
s:name() | |
-- U32J59x |
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
hs.fnutils.each(hs.application.runningApplications(), function(app) print(app:title()) end) | |
-- ... | |
-- 2022-06-05 22:23:40: 1Password | |
-- 2022-06-05 22:23:40: Docker | |
-- 2022-06-05 22:23:40: Notion | |
-- 2022-06-05 22:23:40: Hammerspoon | |
-- ... |
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
hs.geomtery.rect( | |
x starting point right from leftest(?) most part of screen, | |
y starting point down from top part of screen, | |
width of the application, | |
height of the application | |
) |
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
yarn add @vue/apollo-composable @apollo/client |
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
async function getHeaders() { | |
const headers = {} | |
const jwt = // whatever logic you need to fetch your JWT, possible from pinia etc | |
if (jwt) { | |
headers['Authorization'] = `Bearer ${jwt}` | |
} | |
headers['Content-Type'] = 'application/json' | |
return headers |
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
const defaultOptions = { | |
query: { | |
errorPolicy: 'all', | |
}, | |
mutate: { | |
errorPolicy: 'all', | |
}, | |
} | |
function createClient(url) { |
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
export default function (URL1, URL2) { | |
return { | |
default: createClient(URL1), | |
// name this whatever you want instead of `otherClient` | |
otherClient: createClient(URL2) | |
} | |
} |
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 { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client/core' | |
async function getHeaders() { | |
const headers = {} | |
const jwt = // whatever logic you need to fetch your JWT, possible from pinia etc | |
if (jwt) { | |
headers['Authorization'] = `Bearer ${jwt}` | |
} |
OlderNewer