Skip to content

Instantly share code, notes, and snippets.

Avatar

Reid Williams ReidWilliams

View GitHub Profile
@ReidWilliams
ReidWilliams / component.js
Last active Nov 21, 2018
React + styled-components template
View component.js
import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
// locals
// import { theme } from 'styles'
const Root = styled.div``
class MyComponent extends React.Component {
@ReidWilliams
ReidWilliams / container.js
Last active Nov 21, 2018
React Container Pattern Template
View container.js
import React from 'react'
const createContainer = (ComposedComponent) => {
class Container extends React.Component {
render() {
const componentProps = {
...this.props
}
return (
@ReidWilliams
ReidWilliams / git.md
Last active Dec 12, 2018
Git cheatsheet
View git.md

git checkout --track -b <local branch> origin/<tracked branch>

@ReidWilliams
ReidWilliams / regexp-point.txt
Created Feb 21, 2019
Regexp replace POINT(lat, long)
View regexp-point.txt
POINT \((-?\d+.\d+) (-?\d+.\d+)\)
$1,$2
@ReidWilliams
ReidWilliams / ffmpeg.sh
Last active Jun 4, 2019
ffmpeg cheatsheet
View ffmpeg.sh
# images to video at 10 images per second, 64x64 resolution, named like 000000.jpg
# -start_number 12 starts at image 12
# -vframes 100 creates a video with 100 frames
# the -pix_fmt option makes it quicktime compatible
ffmpeg -y -r 10 -f image2 -s 64x64 -start_number 12 -i %06d.jpg -vframes 100 -pix_fmt yuv420p -vcodec libx264 ./video.mp4
# match image names by file glob
ffmpeg -y -r 10 -f image2 -s 1920x1080 -pattern_type glob -i "*.jpg" -pix_fmt yuv420p -vcodec libx264 ../video.mp4
# video to images, image size of 160x128, 10 frames per second, named like 000000.png,
View rsync-cheatsheet.md

rsync -avh source/ destination

-a, archive (recursive and preserve everything about the file)
-v, verbose
-h, human readable sizes

Also useful:
-n, dry run
-z, compress
--delete, delete files that don't exist on the source side

You can’t perform that action at this time.