Skip to content

Instantly share code, notes, and snippets.

View itsrobel's full-sized avatar
🏠
Working from home

Robel Estifanos itsrobel

🏠
Working from home
View GitHub Profile
@itsrobel
itsrobel / Map.js
Created April 22, 2021 07:34
Vue map with open layers geolocation to find Points of interest
<template>
<div ref="map-root" style="width: 100%; height: 100%">
<loading :active="isLoading" :is-full-page="fullPage" :loader="loader" />
</div>
</template>
<script>
import "ol/ol.css";
import "vue-loading-overlay/dist/vue-loading.css";
import Map from "ol/Map";
import View from "ol/View";
@itsrobel
itsrobel / gaze.py
Last active April 22, 2021 07:28
A python Program that locates the x,y coords of each eye using open cv and dlib
import cv2
import dlib
import math
from math import hypot
from math import pi, pow
import numpy as np
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('shape_predictor_68_face_landmarks.dat')
@itsrobel
itsrobel / youtube-dl-script.js
Last active April 22, 2021 07:21
A Node js Script To Visual Install Mp3 files web scraped off of the youtube.com web-page to the be shown in a cli selector and be installed with youtube-dl
const puppeteer = require('puppeteer');
const cheerio = require('cheerio')
const prompt = require('prompt-sync')();
const list = require('cli-list-select');
const youtubedl = require('youtube-dl')
const fs = require('fs')
const path = require('path')
const MUSIC_FOLDER_PATH = "/home/amadeus/Music/"
@itsrobel
itsrobel / chatpage.js
Last active April 22, 2021 07:23
A file in my discord like chat room Application that renders each message sent threw a web socket with a specified room id system
import React, { Component } from "react";
import ChatLogs from "./chatLogs";
import { Redirect } from "react-router-dom";
class ChatPage extends Component {
_isMounted = false;
constructor(props) {
super(props);
this.state = {
msg: "",
chat: [],
@itsrobel
itsrobel / AdminController.java
Last active April 22, 2021 07:24
A Java Controller to my student management system for the admin users
package API.Controllers;
import API.Repositories.AdminRepository;
import API.jwt.JwtTokenUtil;
import API.jwt.JwtUserDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import os
def cls():
os.system('cls' if os.name=="nt" else 'clear')
class Main:
def __init__(self , input_size):
self.active = True
self.players = ['x' , 'o']
self.board = []
self.divided_board_array = None
import pygame
import time
import random
pygame.init()
white = (255 , 255, 255)
black = ( 0 , 0 , 0 )
red = (255, 0 , 0 )
green = (0 , 255, 0)
@itsrobel
itsrobel / socket.js
Last active April 22, 2021 07:25
Node Js Socket Serve
const main = require("./server");
const server = require("http").createServer(main.app);
const io = require("socket.io")(server);
const Chatroom = require("./database/models/chatroom");
const Message = require("./database/models/message");
io.on("connection", (socket) => {
let currentsocket;
socket.join("Home");
io.sockets.in("Home").emit("init", "connected to server");
@itsrobel
itsrobel / passport.js
Last active April 22, 2021 07:25
Nodejs server authentication
const express = require("express");
const Chatroom = require("../database/models/chatroom");
const User = require("../database/models/user");
const router = express.Router();
// gets all chat rooms
router.get("/", (req, res) => {
Chatroom.find()
.then((chatroom) => res.json(chatroom))
.catch((err) => res.status(400).json("Error: " + err));
});