Skip to content

Instantly share code, notes, and snippets.

View 0v3nb1rd's full-sized avatar
🎩
Seek Magic

OvenBird 0v3nb1rd

🎩
Seek Magic
View GitHub Profile
@0v3nb1rd
0v3nb1rd / vscode_shortcuts.md
Created November 18, 2019 19:54 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@0v3nb1rd
0v3nb1rd / nodelistToArray.js
Created November 18, 2019 11:12
NodeList to Array
const div = document.querySelectorAll("div");
console.dir(div); // it's NodeList
Array.from(div); // return Array or
[...div]; // return Array
@0v3nb1rd
0v3nb1rd / CapotalizeText.js
Created October 29, 2019 14:40
Capitalize the first letter of each word of a given string
let str = "i am in the programer";
str = str.split(" ");
for (let i = 0; i < str.length; i++) {
str[i] = str[i][0].toUpperCase() + str[i].substr(1);
}
console.log(str.join(" "));
////// I Am In The Programer
@0v3nb1rd
0v3nb1rd / decrement.js
Created October 27, 2019 19:35
Decrementing 0.6 + 0.7
let val = 0.6 + 0.7;
console.log(+val.toFixed(1)); // 1.3
@0v3nb1rd
0v3nb1rd / randomArray.js
Last active October 27, 2019 19:36
random array
const arr = ["black", "white", "yellow", "purple", "grean"];
const val = Math.floor(Math.random() * arr.length);
console.log(val, arr[val]);
@0v3nb1rd
0v3nb1rd / db.json
Created June 6, 2019 05:13
test_db
{
"cars": [
{
"url": "desktopwallpapers.org.ua/mini/201507/40069.jpg",
"name": "CHEVROLET",
"id": 1,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"date": 1422153200637
},
{
@0v3nb1rd
0v3nb1rd / validateEmail.js
Last active May 8, 2019 12:13
Email validation JS
function validateEmail(email) {
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
@0v3nb1rd
0v3nb1rd / visually-hidden.scss
Created March 1, 2019 07:12
html visually-hidden text (Accessibility)
.visually-hidden {
position: absolute;
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1px;
}
Keymap (Windows Users):
[
{ "keys": ["alt+shift+f"], "command": "reindent" },
]
Settings:
{
"show_definitions": false,
"auto_complete": false,
"bold_folder_labels": true,
@0v3nb1rd
0v3nb1rd / button.scss
Last active March 1, 2019 07:14 — forked from agragregra/button.sass
Button scss Styles (Universal Starter)
.button {
position: relative;
display: inline-block;
padding: 15px 45px;
text-align: center;
border: none;
border-radius: 2px;
color: #fff;
text-decoration: none;
background-color: $accent;