Skip to content

Instantly share code, notes, and snippets.

View ItsCosmas's full-sized avatar
🔨
Building

Cozy! ItsCosmas

🔨
Building
View GitHub Profile
import io.lettuce.core.ReadFrom;
import io.lettuce.core.cluster.ClusterClientOptions;
import io.lettuce.core.cluster.ClusterTopologyRefreshOptions;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.ReactiveRedisClusterConnection;
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
import org.springframework.data.redis.connection.RedisClusterConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
@ItsCosmas
ItsCosmas / BowlingHashMap.java
Last active January 25, 2021 12:35
Sololearn Various Ways to Iterate a HashMap and outputs the name of the player with the maximum points. https://www.sololearn.com/learning/eom-project/1068/972
package com.cozy;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class BowlingHashMap {
HashMap<String, Integer> players;
BowlingHashMap() {
@ItsCosmas
ItsCosmas / command.sh
Created May 12, 2020 19:22
Docker stop and delete all containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@ItsCosmas
ItsCosmas / send.py
Created February 4, 2020 11:02
Send an Image file to client on Python Flask REST
from flask.views import MethodView
from flask import jsonify, request, abort
import uuid
import os
from werkzeug.utils import secure_filename
class MediaAPI(MethodView):
def __init__(self):
@ItsCosmas
ItsCosmas / upload.py
Created February 4, 2020 09:40
Upload Image Files with Python Flask via REST API
from flask.views import MethodView
from flask import jsonify, request, abort
import uuid
import os
from werkzeug.utils import secure_filename
class UploadAPI(MethodView):
def __init__(self):
@ItsCosmas
ItsCosmas / upload.py
Created February 4, 2020 09:00
Upload Base_64 Image File with Python Flask via REST API
from flask.views import MethodView
from flask import jsonify, request, abort
import uuid
import os
from io import BytesIO
from PIL import Image
import base64
import os
i = 0
for file in os.listdir("."):
dst = str(i) + ".jpeg"
src = file
dst = dst
os.rename(src,dst)
i +=1
@import "../../assets/scss/abstracts/variables";
@import "../../assets/scss/abstracts/mixins";
.article {
padding: 4rem;
// Article Main Body
&__main {
padding: 2rem 10rem 10rem 10rem;
}
import React from "react";
import hotpost from "../../assets/img/hot-post-1.jpg";
const ArticleView = () => {
return (
<div className='article__header'>
<h4 className='heading-main'>The Blog Heading Goes Here</h4>
<div className='article__credits'>
Written by <span className='article__author'>Cosmas Cozy </span>
on <span className='article__date'>22 Oct 2019</span>
import React, { Component } from "react";
import sprite from "../../assets/icons/sprite.svg";
class ArticleShare extends Component {
socialItems = [
{ id: 1, name: "icon-facebook", link: "https://facebook.com" },
{ id: 2, name: "icon-twitter", link: "https://twitter.com" },
{ id: 3, name: "icon-instagram", link: "https://instagram.com" },
{ id: 4, name: "icon-linkedin", link: "https://linkedin.com" }