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]));
#.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 / 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));
@o0pmitev
o0pmitev / i3wm_config
Last active November 29, 2018 13:03
i3wm_config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
#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}"
@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;