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
; Extend Layer | |
; Based on https://dreymar.colemak.org/layers-extend.html | |
; Note: I experimented with a lot of different implementations for caps lock as | |
; an extend key using `GetKeyState("CapsLock", "P")`. All of them broke when | |
; typing really fast. In the end this reddit post (https://www.reddit.com/r/AutoHotkey/comments/1fox8q1/typing_too_fast_breaks_my_script/) | |
; solved it by not relying on `GetKeyState` but instead using direct key | |
; combinations. | |
#Requires AutoHotkey v2+ | |
#SingleInstance Force |
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
ColumnLimit: 80 | |
ContinuationIndentWidth: 2 | |
IndentWidth: 2 | |
TabWidth: 2 | |
ConstructorInitializerIndentWidth: 2 | |
IndentCaseLabels: true | |
UseTab: Never | |
SortIncludes: true | |
SortUsingDeclarations: false | |
AlignConsecutiveMacros: false |
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 { readdirSync, rmdirSync, statSync } from 'node:fs' | |
import { join } from 'node:path' | |
export const cleanupEmptyFolders = (folder) => { | |
if (!statSync(folder).isDirectory()) return | |
let files = readdirSync(folder) | |
if (files.length > 0) { | |
files.forEach((file) => cleanupEmptyFolders(join(folder, file))) | |
// Re-evaluate files; after deleting subfolders we may have an empty parent |
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 path = new Path.Circle({ | |
radius: 200, | |
strokeColor: 'blue', | |
center: view.center, | |
strokeCap: 'round', | |
strokeWidth: 3 | |
}) | |
const gap = 50 | |
const offsets = [] |
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 getBottomSegment = (segments) => | |
segments.reduce((prev, curr) => (curr.point.y > prev.point.y ? curr : prev)) | |
const getTopSegment = (segments) => | |
segments.reduce((prev, curr) => (curr.point.y < prev.point.y ? curr : prev)) | |
const wrapSegmentIndex = (path, index) => | |
(index = | |
index < 0 ? path.segments.length + index : index % path.segments.length) |
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
-- Inspired by: lua-users.org/wiki/SimpleLuaClasses | |
function class(base) | |
local c = {} | |
-- Inherit base by making a shallow copy. | |
if type(base) == 'table' then | |
for key,value in pairs(base) do c[key] = value end | |
c._base = base | |
end |