Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🦮
Golden

Davo Galavotti davo

🦮
Golden
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nanlliu
nanlliu / clevr_data_generation.ipynb
Created February 19, 2021 03:44
clevr_data_generation.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JakeCoxon
JakeCoxon / distribute.py
Created December 24, 2020 21:32
Blender addon to distribute objects along an axis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
import SwiftUI
struct PaymentRing: View {
@State var frameSize = UIScreen.main.bounds.width - 120
@State var current: CGFloat = 0
@State var value: Double = 0
var body: some View {
VStack {
ZStack {
Circle().stroke(Color.secondary, style: StrokeStyle(lineWidth: 40, lineCap: .butt, lineJoin: .round)).frame(width: frameSize, height: frameSize)
@pomle
pomle / useContentCache.ts
Last active December 20, 2022 17:54
Captain Hook's Fabulous Hooks
/*
Creates a sticky block of rendered content.
Useful when you want to memoize part of the render tree and optionally rerender.
*/
import { useMemo, useRef } from "react";
export function useContentCache(
renderer: () => React.ReactElement | undefined,
deps: any[]
@mirisuzanne
mirisuzanne / cq.css
Last active October 6, 2021 10:41
Thoughts on Container Queries
/*
This is not meant to be a final CSSWG proposal,
but reflects my immediate thoughts after reading
[David Baron's](https://github.com/dbaron/container-queries-implementability) promising draft.
This gist was created to demonstrate my idea for removing selectors from his query syntax.
More of my thoughts & notes are online at css.oddbird.net/rwd/
*/
main,
@cferdinandi
cferdinandi / README.md
Created October 15, 2020 15:45
A vanilla JS fork of Lettering.js
@k-mao
k-mao / RockPaperScissorsTrainer_ContentView.swift
Created September 21, 2020 10:26
Rock Paper Scissors Trainer
import SwiftUI
struct PlayerMoveEmoji: ViewModifier {
func body(content: Content) -> some View {
content
.font(.system(size: 60))
.padding(.bottom, 8)
}
}
@xiaochengh
xiaochengh / explainer.md
Last active December 14, 2022 09:21
Explainer: Font Metrics Override Descriptors

Explainer: Font Metrics Override Descriptors

(A newer version is at here, where a new descriptor advance-override is added)

Spec

This doc explains descriptors ascent-override, descent-override and line-gap-override for CSS @font-face rule.

Basic usage:

import React from "react";
export type ColorScheme = "light" | "dark";
export default function useColorSchemePreference(
defaultColorScheme: ColorScheme = "light"
) {
let darkQuery = "(prefers-color-scheme: dark)";
let [colorScheme, setColorScheme] = React.useState<ColorScheme>(
typeof window === "object" && window.matchMedia