This file contains hidden or 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
| import * as Rx from "rxjs"; | |
| const observable = Rx.Observable.create((observer) => { | |
| observer.next(Math.random()); | |
| }); | |
| // subscription 1 | |
| observable.subscribe((data) => { | |
| console.log(data); // 0.24957144215097515 (random number) | |
| }); |
This file contains hidden or 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, body { | |
| width: 100%; | |
| height: 100%; | |
| padding: 0; | |
| margin: 0; | |
| } | |
| *, *:after, *:before { | |
| box-sizing: border-box; | |
| } |
This file contains hidden or 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
| Example: find hyper reference with any value in single\double quotes | |
| href=(["'])(?:(?=(\\?))\2.)*?\1 |
This file contains hidden or 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
| $ wget \ | |
| --recursive \ | |
| --no-clobber \ | |
| --page-requisites \ | |
| --html-extension \ | |
| --convert-links \ | |
| --restrict-file-names=windows \ | |
| --domains website.org \ | |
| --no-parent \ | |
| www.website.org/tutorials/html/ |
This file contains hidden or 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
| // Command "gulp start" building with development env by default (env var = undefined) | |
| // "gulp --production" for start building for production mode | |
| // On start all files copying to build folder immediately | |
| gulp = require('gulp'); | |
| minifycss = require('gulp-minify-css'); | |
| rename = require("gulp-rename"); | |
| mode = require('gulp-mode')(); | |
| babel = require('gulp-babel'); | |
| uglify = require('gulp-uglify'); |
This file contains hidden or 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
| // For .png format | |
| // common | |
| convert INPUT.gif_or_png -strip [-resize WxH] [-alpha Remove] OUTPUT.png | |
| // example | |
| convert cuppa.png -strip cuppa_converted.png | |
| //For .jpg format | |
| //common | |
| convert INPUT.jpg -sampling-factor 4:2:0 -strip [-resize WxH] [-quality N] [-interlace JPEG] [-colorspace Gray/sRGB] OUTPUT.jpg | |
| // example |
This file contains hidden or 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 setInputSelection(input, startPos, endPos) { | |
| if (input.setSelectionRange) { | |
| input.focus(); | |
| input.setSelectionRange(startPos, endPos); | |
| } else if (input.createTextRange) { | |
| var range = input.createTextRange(); | |
| range.collapse(true); | |
| range.moveEnd('character', endPos); | |
| range.moveStart('character', startPos); | |
| range.select(); |
This file contains hidden or 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
| npm i -g npm@latest |
This file contains hidden or 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
| //"Module" patterns | |
| const Bucket = (function(){ | |
| let sum = 0; | |
| const goods = []; | |
| return { | |
| printProducts: function() { | |
| goods.forEach(item => console.log(item)); | |
| }, | |
| addProduct: function(product) { |
This file contains hidden or 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--- | |
| <div class="hexagon"> | |
| <div class="hexTop"></div> | |
| <div class="hexBottom"></div> | |
| </div> | |
| ---CSS--- | |
| .hexagon { |