Skip to content

Instantly share code, notes, and snippets.

View hellozimi's full-sized avatar
⌨️
Making stuff!

Simon Andersson hellozimi

⌨️
Making stuff!
View GitHub Profile
@hellozimi
hellozimi / clip-path.ts
Created August 15, 2023 05:36
Generate reverse circle clip-path
// number of verticies
const precision = 64
// radius in percent (where 50 = full circle)
const containerWidth = 40
const borderWidth = 1
const radius = borderWidth/containerWidth // 48.5
const points = [...Array(precision)].map((_, i) => {
let a = -i/(precision-1)*Math.PI*2;
let x = Math.cos(a)*radius + 50;
@hellozimi
hellozimi / cursor.go
Last active May 9, 2022 09:30
Cursor pagination in Go
package cursor
// Cursor is just a string for flexibility
type Cursor string
// NewCursor transforms v into json and base64 encodes the json
func NewCursor(v any) (*Cursor, error) {
b, err := json.Marshal(v)
if err != nil {
return nil, err
@hellozimi
hellozimi / keybase.md
Last active August 18, 2016 09:14
keybase.md

Keybase proof

I hereby claim:

  • I am hellozimi on github.
  • I am simons (https://keybase.io/simons) on keybase.
  • I have a public key ASDAgkj3GsX1uHBk8nVPAeYm6V2fUQYcG0LFmcvCwK5KwAo

To claim this, I am signing this object: