Skip to content

Instantly share code, notes, and snippets.

View ConfidenceYobo's full-sized avatar
Coding

Confidence Yobo ConfidenceYobo

Coding
View GitHub Profile
import 'dart:convert';
import 'dart:math';
import 'dart:io';
class Token {
Map<String, dynamic> parseJwt(String token) {
final parts = token.split('.');
if (parts.length != 3) {
throw Exception('invalid token');
}
@ConfidenceYobo
ConfidenceYobo / .deps...npm...@openzeppelin...contracts...access...Ownable.sol
Created August 7, 2022 09:24
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
# views.py
from myproject.myfunctions import upload_profile_picture
def profile_picture(request):
# setup (checking for post, checking if the
# user is authenticated, etc.)
user = request.user
pic_file = request.FILES['profile_picture']
result_url = upload_profile_picture(pic_file)
@ConfidenceYobo
ConfidenceYobo / README-Template.md
Created July 28, 2020 07:11 — forked from ayesha-ghani098/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

How to install and setup python project on Ubuntu 20.0

Update packages

sudo apt-get update

Install required packages

sudo apt-get install python3 python3-pip

Setup Virtual environment

  • Install Virtual evironment
@ConfidenceYobo
ConfidenceYobo / django-git-workflow.md
Last active March 25, 2024 23:04
Setting up Git workflow for django

Setup Github Actions for Django Project

Step 1

In project root directory the create a folder called '.github'

Step 2

Create a file in the format workflows/django.yml

@ConfidenceYobo
ConfidenceYobo / gist:bc0a8e052f10b9c3d0e22ddd8634e1e6
Last active June 30, 2020 17:36
Small docker container images based on Linux Alpine for Python | Django | Mysql
############################################################
# Dockerfile to build Python | Django | Mysql small container images
# Based on Linux Alpine
############################################################
# Set the base image
FROM alpine
# set work directory
WORKDIR /usr/src/app