{
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** 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" | |
/*************************************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (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])); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#.vscode/settings.json | |
{ | |
"files.exclude": { | |
"node_modules": true, | |
"package-lock.json": true | |
}, | |
"workbench.colorTheme": "Material Monokai High Contrast", | |
"[javascript]" : { | |
"editor.tabSize": 2 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html{ | |
margin: 0; | |
padding: 0; | |
} | |
body { | |
font-family: "#"; | |
font-size: 14pt; | |
background-color: #efefef; | |
padding: 10px; |
NewerOlder