Skip to content

Instantly share code, notes, and snippets.

View beck's full-sized avatar

Doug beck

View GitHub Profile
@beck
beck / search-button.jsx
Created May 7, 2018 15:47
React (+react router) relative url button
import React from 'react';
import styled from 'react-emotion';
import { Link, withRouter } from 'react-router-dom';
import searchIcon from './search.svg';
const StyledLink = styled(Link)`
align-items: center;
background-color: #00A2E1;
background-image: url(${searchIcon});
@beck
beck / git-filter-folder.sh
Created April 26, 2019 19:00
git filter folder
#!/bin/bash
set -eux
# Use this script to prune away everything but `foo/bar/somedir`, resulting with only `somedir`
# in the root. Using `--subdirectory-filter` is undesireable because it hoists all the contents
# of `somedir` into the root.
mkdir -p __github-migrate__
mvplz="if [ -d $1 ]; then mv $1 __github-migrate__/; fi;"
git filter-branch -f --tree-filter "$mvplz" HEAD
@beck
beck / hello.ts
Last active May 11, 2020 17:02
VS Code import woe - Cannot find module (2307)
export const msg = "hello";