Skip to content

Instantly share code, notes, and snippets.

View hozefaj's full-sized avatar

Hozefa hozefaj

View GitHub Profile
@isRuslan
isRuslan / index.js
Created April 1, 2015 21:44
JS: rotate array with N
/**
* Write a function that takes an array of integers
and returns that array rotated by N positions.
For example, if N=2, given the input array [1, 2, 3, 4, 5, 6]
the function should return [5, 6, 1, 2, 3, 4]
*/
var rotate = function (arr, n) {
var L = arr.length;
return arr.slice(L - n).concat(arr.slice(0, L - n));
};
@hozefaj
hozefaj / emoji.md
Last active October 25, 2018 18:44 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@hozefaj
hozefaj / utils.js
Last active August 16, 2017 17:16
JS code to show passwords field values when filling forms
// change passwords fields into text on a web page
const nodeList = document.getElementsByTagName("input");
[...nodeList].forEach(node => {
if(node.getAttribute("type") === "password"){
node.setAttribute('type', 'text');
}
});
// wrap code within github to multiple lines
// this helps to prevent horizontal scroll