Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🦮
Golden

Davo Galavotti davo

🦮
Golden
View GitHub Profile

Recursively Remove .DS_Store

find . -name '.DS_Store' -type f -delete

@davo
davo / beach-house-tour.md
Created June 12, 2019 15:00
Beach House
  • JUNE 14
    MANCHESTER, TN
  • AUG 1
    BURLINGTON, VT
  • AUG 3
    MONTREAL, CA
  • AUG 4
    NORTHAMPTON, MA
  • AUG 6
    CLEVELAND, OH
import * as React from "react"
import { Frame, addPropertyControls, ControlType } from "framer"
type Props = {
width: number | string
height: number | string
color: string
}
export const SvgComponent = (props: Props) => {
@davo
davo / Colors.tsx
Created May 21, 2019 21:38
Reusing Framer X Shared Colors on a Function Component
import * as React from 'react'
import { Stack, Frame } from 'framer'
import { colors } from './canvas'
export function Colors() {
const [colorsTokens] = React.useState(() => {
return Object.keys(colors).map(key => colors[key])
})
return (
@davo
davo / observable.tsx
Created May 20, 2019 21:44
Observable book on Framer X
import * as React from 'react'
import { useState, useEffect, useRef } from 'react'
import { Frame, addPropertyControls, ControlType } from 'framer'
import { Runtime, Inspector } from '@observablehq/runtime'
import notebook from '@davo/bar-chart-race'
export function Observable({ tick }) {
const [tickDuration, setTickDuration] = useState(tick)
const animationRef = useRef()
@davo
davo / WindowResizeListener.tsx
Created May 17, 2019 22:32
Framer X WindowResizeListener
// https://framer.slack.com/archives/CB74N2FDY/p1557954143213500?thread_ts=1557952502.211200&cid=CB74N2FDY
import { Override, Data } from "framer"
import * as React from "react"
const initialSize = document.body.getBoundingClientRect()
const preview = Data({ width: initialSize.width, height: initialSize.height })
@davo
davo / regexs.md
Created May 14, 2019 15:18
Handy Regular Expressions

Capturing a class from a HTML / SVG element.

(class="([^"]*)")
@davo
davo / ComponentHoverStyledComponents.tsx
Created May 6, 2019 15:33
Component with Hover via StyledComponents
import * as React from 'react'
import { useState, useEffect } from 'react'
import { Frame, addPropertyControls, ControlType } from 'framer'
import styled, { css } from 'styled-components'
interface Props {
padding?: number
paddingLeft?: number
color?: string
listBackgroundColor?: string
@davo
davo / Table.tsx
Created April 23, 2019 22:12
Custom CSS Props with Styled Components
import * as React from 'react'
import ReactTable from 'react-table'
import { CSSCustomProperties, TableWrapper } from './TableWrapper'
interface Props {
rowSize?: string | number
}
export class Table extends React.Component<Props> {
static defaultProps = {
@davo
davo / command.sh
Created April 4, 2019 17:21
How to Exclude Sketch From Dark Mode in macOS Mojave
osascript -e 'id of app "Sketch"'
defaults write com.bohemiancoding.sketch3 NSRequiresAquaSystemAppearance -bool yes