Skip to content

Instantly share code, notes, and snippets.

View mobileappconsultant's full-sized avatar

Arkangel mobileappconsultant

  • Mobile Paradigm
View GitHub Profile
//
// RecipeListScreen.swift
// FoodToForkApple
//
// Created by samson akisanya on 19/01/2023.
// Copyright © 2023 orgName. All rights reserved.
//
import SwiftUI
import shared
@mobileappconsultant
mobileappconsultant / MVI problem
Created December 2, 2020 09:19
This is an MVI implementation that has a bug. Onclick in the from the MVIFragment isn't firing off any action.
sealed class MoneyBoxIntent : MviIntent {
data class LoginIntent(val loginRequestBody: LoginRequestBody) : MoneyBoxIntent()
object GetAllInvestorProductsIntent : MoneyBoxIntent()
object MakeOneOffPaymentIntent : MoneyBoxIntent()
}
****************************************************************************************************************************************
package com.android.moneybox.presentation
import androidx.lifecycle.ViewModel
import com.android.moneybox.domain.mvi.moneyboxactions.MoneyBoxAction
@mobileappconsultant
mobileappconsultant / brute_force.py
Last active January 29, 2019 10:47
Simple demo of library that arranges all characters of a string in max number of possible ways
import itertools
count =0;
stringInput = input(("Enter a string: "))
for p in itertools.permutations(stringInput):
count = count +1
print("{},{}".format(count,p))
import asyncio
import aiohttp
### Concurrency .. Simple Definition: using threads to execute tasks. Simple Analogy: Imagine how frustrating it'd be or how long it'd take
# if there was only 1 platform
# at Woolwich Arsenal station and you are travelling to London Bridge. So you have to wait for the train to arrive from London Bridge
# and for people to disembark from the train before you get a chance to begin your journey to London Bridge. Or even simpler imagine Ade's Cash
# and Carry with only 1 till open and you are doing Christmas shopping.. Happens sometimes :) Python provides a construct called async/await.
@mobileappconsultant
mobileappconsultant / Side Projects
Created January 4, 2019 16:53
A list of projects currently working on outside work for the purpose of broadening my horizons.
CFT Platform (Backend/Frontend)
CFT platform is information dissemination platform developed specifically for a Christian community in london.
It allows an administrator share information about services and events within the church.
The platform enables users to offer donations thru the Stripe payment Gateway.
The platform provides a curated list of youtube videos within the app
@mobileappconsultant
mobileappconsultant / function_arguments_unpacking.py
Created December 16, 2018 09:58
Very simple script to practice the syntax for function unpacking
# declare a simple tuple and dictionary
tuple_easy = (1, 2, 3, 4, 5, 6, 6, 7)
simple_dict = {'a': 2, 'b': 1, }
# try to display their contents, observe the result
print(tuple_easy)
print(simple_dict)
# use arg unpacking to extract the contents
print(*tuple_easy)
@mobileappconsultant
mobileappconsultant / utilitytodeletefiles.py
Created December 14, 2018 17:41
A very simple and basic script to delete unwanted folders of a very specific type, in this case, .dmg files.
import os
import fnmatch
CONSTANT_DIRECTORY_TO_CLEAN = "/Users/arkangel/Downloads/"
os.chdir(CONSTANT_DIRECTORY_TO_CLEAN)
# ensure that change to that directory worked
print(os.getcwd())
# just to get an idea of all the files in that directory
@mobileappconsultant
mobileappconsultant / tfltravelguide.py
Last active December 7, 2018 15:01
Python app to allow a user plan their journey from start to destination using Transport For London Live Service
#!/usr/bin/env python3
import requests
import re
import json
import sys
import time
##### IF YOU ARE USING COMMAND LINE TO RUN THIS PLS DO pip install requests re json sys time
# get current postcode from user -> DONE
# get destination postcode from user -> DONE
@mobileappconsultant
mobileappconsultant / python_keywards.py
Last active December 5, 2018 12:34
List all the commands or reserved keywords in python. Practice lambda syntax
import keyword
print(keyword.kwlist)
print("There are {} commands in Python".format(len(keyword.kwlist)))
# a is a lambda that takes an input x and performs an operation : x**2
# a is variable name assigned to lamda(python keyword) that takes an input x and(:) ..whatever comes after : is the operation
a = lambda x:x**2
@mobileappconsultant
mobileappconsultant / BasicPandas.py
Created December 4, 2018 15:25
Playing around with Pandas Module
import pandas as pd
import sys
import os
clear = lambda: os.system("clear") #on Linux System
clear()
def processUserOptions(argument):
switchOptions = {