git checkout --track -b origin/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POINT \((-?\d+.\d+) (-?\d+.\d+)\) | |
$1,$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
const createContainer = (ComposedComponent) => { | |
class Container extends React.Component { | |
render() { | |
const componentProps = { | |
...this.props | |
} | |
return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rename a dataframe column | |
dataframe = dataframe.rename(index=str, columns={'old_col_name': 'new_col_name'}) | |
# get all possible values for a string / categorical column | |
dataframe[column].value_counts(dropna=False) | |
# group data and count number of rows in a group | |
grouped = dataframe.groupby(color) | |
nreds = len(grouped.get_group('red')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip freeze > requirements.txt | |
$ pip install -r requirements.txt |
NewerOlder