Skip to content

Instantly share code, notes, and snippets.

View bwswedberg's full-sized avatar

Brian Swedberg bwswedberg

View GitHub Profile
@sgyyz
sgyyz / docker-compose.yml
Last active July 4, 2022 04:13
Postgres & PgAdmin docker-compose.yml
version: '3'
services:
postgres:
image: postgres
ports:
- "5432:5432"
volumes:
- pg-dataset:/var/lib/postgresql/data
environment:
@herr-vogel
herr-vogel / material-ui-next-js-button.js
Last active November 16, 2021 10:14
Using Material-UI Button with Next.js Link
import React from 'react'
import Link from 'next/link'
import Button from '@material-ui/core/Button'
const ButtonLink = ({ className, href, hrefAs, children, prefetch }) => (
<Link href={href} as={hrefAs} prefetch>
<a className={className}>
{children}
</a>
</Link>
@shimizu
shimizu / .block
Last active May 10, 2018 17:07
D3 v4 + leaflet v1
license: mit
@armollica
armollica / README.md
Last active December 13, 2023 12:29
Convert SVG to Canvas

Convert SVG to canvas on-the-fly.

This article from MDN explains the process: Drawing DOM object into a canvas. This works for any DOM object, not just SVG. Not sure if this is well supported by older browsers. Works on Chrome, Firefox and IE 10 for me. The bar chart is a fork of this block by Mike Bostock: Canvas Bar Chart.

@armollica
armollica / .block
Last active May 31, 2018 23:14
Life on the Mississippi
height: 3000
@armollica
armollica / .block
Last active May 2, 2019 08:22
HTML Annotation
height: 960
@mbostock
mbostock / .block
Last active March 19, 2024 07:45
Wrapping Long Labels
license: gpl-3.0
@eweitnauer
eweitnauer / README.md
Created October 11, 2013 21:03
Quadtree 3

This example demonstrates how to take the size of objects into account when selecting objects efficiently with a quadtree. Selected objects are shown in red, visited but not selected objects are shown in yellow. The efficiency depends on the biggest width and biggest height among all object. It is assumed that all objects are rectangle-shaped.

Example series:

Based on Mike Bostock's quadtree example.

@cobyism
cobyism / gh-pages-deploy.md
Last active June 12, 2024 20:14
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@mbostock
mbostock / .block
Last active March 6, 2024 04:06
Gradient Along Stroke
license: gpl-3.0