Skip to content

Instantly share code, notes, and snippets.

View readikus's full-sized avatar

Ian Read readikus

View GitHub Profile
'''
Experimenting with asyncio.TaskGroup to load a collection of URLs. This provides a similar approach as
Promise.all in JavaScript
'''
import aiohttp
import asyncio
from codetiming import Timer
import urllib
@readikus
readikus / news-trend-demo-pieces.ipynb
Created September 29, 2021 12:44
News trend demo pieces.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@readikus
readikus / numpy-101.ipynb
Last active September 2, 2021 08:12
Numpy 101.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@readikus
readikus / numpy-101.ipynb
Last active September 1, 2021 08:01
Numpy 101.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
PassengerId Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
892 3 Kelly, Mr. James male 34.5 0 0 330911 7.8292 Q
893 3 Wilkes, Mrs. James (Ellen Needs) female 47 1 0 363272 7 S
894 2 Myles, Mr. Thomas Francis male 62 0 0 240276 9.6875 Q
895 3 Wirz, Mr. Albert male 27 0 0 315154 8.6625 S
896 3 Hirvonen, Mrs. Alexander (Helga E Lindqvist) female 22 1 1 3101298 12.2875 S
897 3 Svensson, Mr. Johan Cervin male 14 0 0 7538 9.225 S
898 3 Connolly, Miss. Kate female 30 0 0 330972 7.6292 Q
899 2 Caldwell, Mr. Albert Francis male 26 1 1 248738 29 S
900 3 Abrahim, Mrs. Joseph (Sophie Halaut Easu) female 18 0 0 2657 7.2292 C
# The Product
Do you believe in it? Or are you just interested as they're paying big bucks?
# The People
Culture = people. Don't work with toxic people (aka dicks).
## The Other Developers
@readikus
readikus / Deploying a React webapp.md
Last active December 5, 2020 19:09
Steps for deploying a web app on AWS (or similar) using React, Express, Nginx and Docker

Deploying a React webapp on AWS (or similar) using React, Express, Nginx and Docker

It's important to understand the big piocture of what we are trying to do with this. The diagram below shows the path http requests come in from the browser when trying to get data from the web app. If we don't understand this overall path and what we are trying to achieve, we risk getting stuck cargo coding bits and pieces from various tutorials and don't really know how to fix issues/keep up to date.

Before getting into this, make sure you completely understand this https://flaviocopes.com/http-request/

Infrastructure diagram - react, express, nginx, docker, aws

Milestones

@readikus
readikus / server.js
Created June 26, 2020 06:56
Code for uploading an image in nodejs
/*
The main extra bit you need for this is to use the multer middleware. A middleware is an extra bit you add that just gives additional functionality - i.e. it gives express the ability to handle multi-part forms.
Install multer using the npm command and save it to package.json - will let you look that up to make sure you learn it, as you do it all the time :)
NPM docs: https://www.npmjs.com/package/multer
*/
const express = require('express');
// include the dependancy:
  1. Create a directory and an npm module for you service using npm init from the command line in the directory. This creates a package.json file that will configure how that service runs. Use server.js instead of index.js
  2. Add express dependancy to your project. From the comman line type:

npm i -s express

This means "node package manager, install (i) and save it to the package.json file (-s) the express package".

  1. Create a server.js file like: