Skip to content

Instantly share code, notes, and snippets.

View da115115's full-sized avatar

Denis A da115115

  • France
  • 14:01 (UTC +02:00)
View GitHub Profile
@da115115
da115115 / getGitHubLatestRelease.sh
Created May 18, 2019 11:10
Extract the release tag (version) of the latest release of a given GitHub repository, potentially for specific OS, architecture and package type
#!/bin/bash
git_repo="containernetworking/plugins"
os="linux"
arch="amd64"
pack="tgz"
if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ]
then
echo
import pandas as pd
from sklearn import linear_model
X_0 = pd.DataFrame([[0,0], [1,0]] )
y_0 = pd.DataFrame([[0], [0]])
X_1 = pd.DataFrame([[0,1], [1,1], [1,1]])
y_1 = pd.DataFrame([[1], [1], [1]])
@npearce
npearce / install-docker.md
Last active May 21, 2025 14:32
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
from pyspark.sql.types import *
from pyspark.sql.functions import *
#Flatten array of structs and structs
def flatten(df):
# compute Complex Fields (Lists and Structs) in Schema
complex_fields = dict([(field.name, field.dataType)
for field in df.schema.fields
if type(field.dataType) == ArrayType or type(field.dataType) == StructType])
while len(complex_fields)!=0:
@bstopp
bstopp / TerraformRolePolicy.json
Created July 4, 2018 19:22
AWS Assume Role Issue Examples
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "S3BucketAccess",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::bstopp"
},
@katzefudder
katzefudder / Dockerfile
Last active December 6, 2022 07:44
AWS CLI dockerized with Alpine Linux
FROM alpine:3.14
ENV AWSCLI_VERSION "1.20.7"
RUN apk add --update \
python3 \
python3-dev \
py-pip \
build-base \
&& pip install awscli==$AWSCLI_VERSION --upgrade --user \
@blakewest
blakewest / mnist_example.ipynb
Created February 9, 2018 17:26
Example implementation of a Convolutional Neural Net for the MNIST data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yaroslavvb
yaroslavvb / kfac_nano_eager_test.py
Last active May 31, 2018 22:11
Small example of KFAC in Eager mode
import numpy as np
import tensorflow as tf
import scipy
from tensorflow.contrib.eager.python import tfe
tfe.enable_eager_execution()
# manual numpy example
# X = np.array(([[0., 1], [2, 3]]))
# W0 = X
# W1 = np.array(([[0., 1], [2, 3]]))/10
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
app = dash.Dash()
df = pd.read_csv(
'https://gist.githubusercontent.com/chriddyp/'
# See official docs at https://dash.plotly.com
# pip install dash pandas
from dash import Dash, dcc, html, Input, Output
import plotly.express as px
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv')