Skip to content

Instantly share code, notes, and snippets.

@aolufisayo
aolufisayo / queue.py
Created July 27, 2022 19:12
queue data structure implementation in python
class Node:
def __init__(self, value):
self.value = value
self.next = None
class Queue:
def __init__(self, value):
new_node = Node(value)
self.first = new_node
@aolufisayo
aolufisayo / stack.py
Created July 26, 2022 11:46
implementation of a stack data structure
class Node:
def __init__(self, value):
self.value = value
self.next = None
def __str__(self):
return str({"value": self.value, "next": self.next})
class Stack:
@aolufisayo
aolufisayo / ll.py
Last active July 20, 2022 20:13
Linked List python
class Node():
def __init__(self, value):
self.value = value
self.next = None
def __str__(self):
return str({"value": self.value, "next": self.next})
class LinkedList:
@aolufisayo
aolufisayo / openai-setup-on-windows10.md
Last active November 13, 2021 12:19
Description of how to setup open ai gym on windows using anaconda

To run open ai gym on windows 10 with anaconda installed

create a new environment in anaconda, install 'command prompt' and follow the steps below

install pytorch

conda install pytorch torchvision torchaudio cpuonly -c pytorch-lts

install stablebaselines3 package

pip install stable-baselines3[extra]

@aolufisayo
aolufisayo / commands.md
Created December 1, 2020 07:35
docker commands for running postgresql with django

check running docker services

docker ps

open bash command prompt on postgres container

docker exec -it 'postgres container name' bash

login to postgres

psql -U postgres

create a database

@aolufisayo
aolufisayo / udacity_ai_foundations.md
Last active June 7, 2020 19:56
my notes to the udacity artificial intelligence foundations.

software engineering practices part 1 - lesson two

  1. python codes should be indented by 4 spaces.
  2. python doc strings are denoted by three double quotes.
  3. a module is just a file. it allows code to be reusable by encapsulating them into a file which makes it easier to import into other files.
  4. production code is software running on production servers to handle live users and data of the intended audience.
  5. a code is modular if it is logically broken up into functions and modules.
  6. limit python code lines by 79 characters ( as specified by pep guidelines )
  7. types of documentation -line level (inline comments) -function or module level
@aolufisayo
aolufisayo / 1---README.md
Created February 16, 2020 03:54 — forked from lostintangent/1 - Intro---README.md
Learning MobX (Side-Effects)

Welcome to the interactive tutorial on how to use side-effect "operators" in MobX! Over the course of the next three samples, you'll learn (and be able to explore) exactly how autorun, when and reaction work, and when/why you would use them when building reactive applications.

1: autorun

autorun takes a function, and immediately runs it. Upon execution, it detects any observables that the function accesses (e.g. observable.property), and will automatically re-run the function anytime those observables change.

For example, you should have seen the Loading changed alert display immediately when viewing/running this playground. This is because of the initial autorun call here. If you click either of the two buttons below, you'll see the alert again.

However, if you click the same button multiple times, you won't see the alert, because the observable isn't changing. Try it for yourself!

@aolufisayo
aolufisayo / rn_gesture.js
Created August 5, 2019 12:03
React Native Gesture Blurview Drawer
// This SNACK is a follow up of this tweet:
// https://twitter.com/MengTo/status/1142539362875392001
// I just wanted to recreate it using React Native ❤️
// Take the code as it is, I'll not refactor it -> unnecessary effort
import React, { Component } from 'react';
import {
TouchableOpacity,
StatusBar,
Text,
ImageBackground,
@aolufisayo
aolufisayo / custom-resolvers.js
Created July 27, 2019 03:55
a sample custom resolver for hasura
const { ApolloServer } = require('apollo-server');
const gql = require('graphql-tag');
const jwt = require('jsonwebtoken');
const fetch = require('node-fetch');
const typeDefs = gql`
type auth0_profile {
email: String
picture: String
}
type Query {
@aolufisayo
aolufisayo / WorkbookReactNative5.md
Created March 8, 2019 07:29 — forked from johnwylie70/WorkbookReactNative5.md
Getting Workbook running with React Native

Use Storybook version 4.1.13 as 5 is not ready for React Native

Tested: 6th March 2019

Install mac homebrew:

Download rom here: https://brew.sh/ `

Setup brew