Skip to content

Instantly share code, notes, and snippets.

View tol-is's full-sized avatar
🏠
Working from home

Tolis C. tol-is

🏠
Working from home
View GitHub Profile
@tol-is
tol-is / use-timer.tsx
Created April 3, 2024 06:48
useTimer
import { useRef } from 'react'
export type UseTimerProps = {
duration: number
onFrame: (percent: number) => void
onComplete: () => void
}
export const useTimer = (props: UseTimerProps) => {
const { duration: propsDuration, onFrame, onComplete } = props
@tol-is
tol-is / app.tsx
Last active February 5, 2024 13:48
React - get scroll position
import React, { useRef, useState } from "react";
import { useScrollPosition } from "./use-scroll-position";
import { normalize } from "./normalize";
import "./styles.css";
export default function App() {
const percentRef = useRef<HTMLDivElement>(null);
const p1Ref = useRef<HTMLParagraphElement>(null);
@tol-is
tol-is / pliim-turnOff.scpt
Created December 17, 2023 22:15 — forked from zehfernandes/pliim-turnOff.scpt
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
@tol-is
tol-is / gist:c8dcd063d23504e7d3f2768c246b47fa
Created October 11, 2023 12:27
Most common kerning pairs
504 L T
499 L V
495 L Y
493 T A
491 P comma
490 T a
489 V A
489 T period
489 A V
488 Y o
@tol-is
tol-is / Build-and-Publish.md
Created December 15, 2022 23:24 — forked from OleksiyRudenko/Build-and-Publish.md
Building and publishing a web app @ github pages using ParcelJS
@tol-is
tol-is / getToc.js
Last active January 6, 2022 20:35
Get table of contents from markdown
const getToc = (source: string) =>
source
.split("\n")
.map((line) => {
const matches = line.match(/^#+[\s]+/);
return matches
? {
level: matches[0].trim().length,
heading: line.replace(matches[0], "").trim(),

Give us an example of a product you really admire and explain why you think it has been designed well

Describe what signals to you that an organisation is set up to do design/engineering well?

Describe a time when you have worked in a great product engineering team. What made it great?

Share one item of your best work

Tell us what makes this work great

@tol-is
tol-is / assert.md
Created November 15, 2020 21:31 — forked from jamiebuilds/assert.md

assert() (sometimes called invariant())

Instead of checks like:

if (value === null) {
  throw new Error("missing value")
}
doSomethingThatNeedsValue(value)
/*
* Test supported OpenType features in a font
* (see opentype_features_for_cjk Cookbook topic for CJK features)
*
* Demonstrate supported typographic OpenType features after checking
* whether a particular feature is supported in a font. Only those features
* will be shown which are
* a) available in the font
* b) are supported by PDFlib's "features" option
* c) are not used automatically for shaping and layout features
export const carbonScale = (params = {}) => {
const {
length = 20,
minSize = 10,
intervals = 4,
increment = 2,
transform = v => v
} = params;
const getSize = count => {