$ npm install mocha
$ mkdir test
$ $EDITOR test/test.js # or open with your favorite editor
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
function HEX2RGB (hex) { | |
"use strict"; | |
if (hex.charAt(0) === '#') { | |
hex = hex.substr(1); | |
} | |
if ((hex.length < 2) || (hex.length > 6)) { | |
return false; | |
} | |
var values = hex.split(''), | |
r, |
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
function px2cm(px, dpi) { | |
return px * 2.54 / dpi | |
} | |
console.log(px2cm(1, 268)) |
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
[ | |
{ | |
"name": "Ethereum Mainnet", | |
"rpc": [ | |
"https://cloudflare-eth.com" | |
], | |
"shortName": "ethereum-mainnet" | |
}, | |
{ | |
"name": "OP Mainnet", |
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
The position property specifies the type of positioning method used for an element (static, relative, fixed, absolute or sticky). | |
- Position: `position: static | relative | absolute | fixed | sticky` | |
- Position Properties: `top | right | bottom | left ` | |
- Float Element: `float: left | right | none` | |
- Clear Floating Elements: `clear: none | left | right | both` | |
- Index: `z-index: 3 | auto | inherit` | |
[CSS Cheat Sheet](https://simplecheatsheet.com/tag/css-cheat-sheet/) |
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
// Requiring lodash library | |
const _ = require('lodash'); | |
// Using _.debounce() method | |
// with its parameters | |
var debounce_fun = _.debounce(function () { | |
console.log('Function debounced after 1000ms!'); | |
}, 1000); | |
debounce_fun(); |
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
window.addEventListener('dragover', function(e) { | |
e.stopPropagation(); | |
e.preventDefault(); | |
}); | |
window.addEventListener('drop', function(e) { | |
e.stopPropagation(); | |
e.preventDefault(); | |
if(e.dataTransfer.files.length === 0) { | |
return alert("Seems like you tried to drag-and-drop an image from another browser window? You need to download the image to your computer (right-click, then save image) and then drag-and-drop the downloaded image. Sorry!"); |
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
<!doctype html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta property="og:title" content=""> | |
<meta property="og:type" content=""> |
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
version: "3" | |
services: | |
redis: | |
image: redis:alpine | |
ports: | |
- "6379" | |
networks: | |
- frontend | |
deploy: |
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
version: '3.7' | |
services: | |
web: | |
image: nginx:alpine | |
ports: | |
- "8000:80" | |
volumes: | |
- ./app:/usr/share/nginx/html |
OlderNewer