Skip to content

Instantly share code, notes, and snippets.

View lixiaoyan's full-sized avatar

XiaoYan Li lixiaoyan

  • Beijing, China
  • 08:29 (UTC +08:00)
View GitHub Profile
@lixiaoyan
lixiaoyan / Kara.vil
Last active November 28, 2023 05:07
{
"version": 1,
"uid": 6781217894371684000,
"layout": [
[
[
"KC_ESCAPE",
"KC_1",
"KC_2",
"KC_3",
import { useState } from "react";
export const useStateWithDeps = <T>(
initialState: T | (() => T),
deps: unknown[],
) => {
const [state, setState] = useState(initialState);
const [currentDeps, setCurrentDeps] = useState(deps);
if (!shallowEqual(deps, currentDeps)) {
-- https://www.hammerspoon.org/
focusWorkaroundWatchers = {}
local lastActivatedApp = nil
local restoreActivationTimer = nil
local lastFocusedWindowBySpace = {}
focusWorkaroundWatchers.application = hs.application.watcher
.new(function(name, event, app)
if event == hs.application.watcher.activated then