Skip to content

Instantly share code, notes, and snippets.

View o0pmitev's full-sized avatar
👾
alt='Image of a space invader'

Plamen Mitev o0pmitev

👾
alt='Image of a space invader'
View GitHub Profile
@o0pmitev
o0pmitev / helpers.js
Last active February 1, 2024 04:58
helpers
/**
* @description Gets the coordinates of the mouse click on given element (x, y)
* @param {string} elementClass class name of the element
*/
function getElementClickOriginPoint(elementClass) {
document.querySelector(`.${elementClass}`).onclick = function(e) {
var rect = e.target.getBoundingClientRect();
var x = e.clientX - rect.left; // x position within the element.
var y = e.clientY - rect.top; // y position within the element.
console.log(x, y);
@o0pmitev
o0pmitev / git-fetch-rebase-workf.txt
Created March 17, 2023 16:19 — forked from programaker/git-fetch-rebase-workf.txt
A simple Fetch/Rebase git workflow
/*** Git configuration in eclipse ***/
/* Setup */
- In Preferences > Team > Git > Label Decorations > Icon Decorations => check all
- In Git perspective > Synchronize button > Synchronize => synchronize git destination .../origin/master
- In Preferences > Team > Perspective => Change "Team Synchronize" to "Git"
/*************************************************************************************************/
@o0pmitev
o0pmitev / setup.md
Created March 2, 2023 18:28 — forked from GooRiOn/setup.md
Git For Win + Windows Terminal Setup
// (3) Convert the following array of arrays in flatten array: [1, 2, 4, 8, 6, 11, 3 , 7]
const toFlatten = [1, 2, [4, 8, [6, 11]], 3, 7];
function flatten(arr) {
let newArray = [];
for(let i = 0; i < arr.length; i++) {
if(typeof(arr[i]) === 'object') {
newArray.push(...flatten(arr[i]));
@o0pmitev
o0pmitev / index.html
Last active April 23, 2022 03:45
Responsive Website: Portfolio
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abril+Fatface|Oswald|Orbitron|KoHo|Cute+Font">
<title>Plamen Mitev`s page</title>
#.vscode/settings.json
{
"files.exclude": {
"node_modules": true,
"package-lock.json": true
},
"workbench.colorTheme": "Material Monokai High Contrast",
"[javascript]" : {
"editor.tabSize": 2
},
puts "Say something "
text = gets.chomp
text.downcase!
puts "Words you want to redact ?"
redact = gets.chomp
redact.downcase!
words = text.split(" ")
words.each do |w|
if w == redact
@o0pmitev
o0pmitev / blog.css
Last active December 18, 2018 22:50
Blog Page
html{
margin: 0;
padding: 0;
}
body {
font-family: "#";
font-size: 14pt;
background-color: #efefef;
padding: 10px;
@o0pmitev
o0pmitev / bmiCalculator.js
Created December 10, 2018 21:13
js training
// bmiCalculator
console.log("Calcilate your Body Mass Index(BMI)");
console.log("************************************");
let weightKg = 67;
let heightCm = 177;
//bmi calculation
const bmi = weightKg/((heightCm/100)*(heightCm/100));
#BMIcalculator
puts "Calculate Your Body Mass Index (BMI)"
puts "************************************"
#greetings
puts "What is your name ?"
name = gets.chomp
if name ==""
puts "Hello Stranger!"
else
puts "Hello #{name}"