Skip to content

Instantly share code, notes, and snippets.

View joshmenden's full-sized avatar

Josh Menden joshmenden

  • YNAB
  • Lehi UT
View GitHub Profile
goToDraft () {
this.draft = response.data.draft
if (draft.status === 'OK') {
this.$router.push('/')
}
}
@joshmenden
joshmenden / hammerspoonbounce.lua
Created November 27, 2020 17:06
HammerspoonBounce
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
-- 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
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
-- ...
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
)
yarn add @vue/apollo-composable @apollo/client
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
const defaultOptions = {
query: {
errorPolicy: 'all',
},
mutate: {
errorPolicy: 'all',
},
}
function createClient(url) {
export default function (URL1, URL2) {
return {
default: createClient(URL1),
// name this whatever you want instead of `otherClient`
otherClient: createClient(URL2)
}
}
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}`
}