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
<html> | |
<body> | |
<script type="module"> | |
// Use a simple local http server like 'python3 -m http.server' | |
// Needs to liston on port 8000 | |
// Janky, but I use a local copy of the Ethers libray to avoid CORS headaches | |
// https://cdn.ethers.io/lib/ethers-5.2.esm.min.js | |
// Ethers docs: | |
// https://docs.ethers.io/v5/getting-started/ |
# resize all files in directory <in> so that the shorter dimension (or both dims) is 64 pixels, then | |
# crop the longer dimension to 64 pixels. | |
magick convert in/* -resize 64x64^ -gravity center -extent 64x64 'out/%06d.jpg' | |
# crop images using find / exec. Find / exec is useful when there are many images and file globs don't work. | |
# Crop to 1150 by 512 at the top, left edge of the image | |
find ./*.jpg -exec magick convert {} -crop 1150x512+0+0 {} \; |
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
# 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, |
POINT \((-?\d+.\d+) (-?\d+.\d+)\) | |
$1,$2 |
git checkout --track -b origin/
import React from 'react' | |
const createContainer = (ComposedComponent) => { | |
class Container extends React.Component { | |
render() { | |
const componentProps = { | |
...this.props | |
} | |
return ( |
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 { |
// Dependencies | |
import React from 'react' | |
import { storiesOf } from '@storybook/react' | |
import centered from '@storybook/addon-centered' | |
import { action } from '@storybook/addon-actions' | |
// Local Dependencies | |
import { ComponentDecorator } from 'stories/decorators' | |
import MyComponent from './index' |
def estimate(self, X): | |
""" Use saved model to predict/estimate retention probability. | |
Arguments: | |
X (dict): dictionary of features, values. | |
Automatically uses model trained on same set of features as | |
X argument. | |
Returns: | |
List of one element, retention probability. |