Skip to content

Instantly share code, notes, and snippets.

View steelersd's full-sized avatar

Adam steelersd

View GitHub Profile
@Per48edjes
Per48edjes / ColumnTransform_pipeline_field_extraction.py
Created November 13, 2019 22:44
Get column names from ColumnTransformer with embedded pipelines (SKLearn)
## Split into holdout for purposes of imputation and encoding
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = .2, random_state=2019)
class_labels = df['segment_label'].cat.categories
## Preprocessing pipeline
# Define transforms on numeric types
numeric_features = X.select_dtypes(np.number).columns
numeric_transformer = Pipeline(steps=[
('imputer', SimpleImputer(strategy='median')),
@so0k
so0k / kubectl.md
Last active September 11, 2024 08:36
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@JacobBennett
JacobBennett / blog.md
Last active September 4, 2024 18:48
Clean up your Vue modules with ES6 Arrow Functions

Recently when refactoring a Vue 1.0 application, I utilized ES6 arrow functions to clean up the code and make things a bit more consistent before updating to Vue 2.0. Along the way I made a few mistakes and wanted to share the lessons I learned as well as offer a few conventions that I will be using in my Vue applications moving forward.

The best way to explain this is with an example so lets start there. I'm going to throw a rather large block of code at you here, but stick with me and we will move through it a piece at a time.

<script>

// require vue-resource...

new Vue({
@gaearon
gaearon / connect.js
Last active June 24, 2024 09:43
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (