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
| var gulp = require("gulp"), | |
| browserSync = require('browser-sync'); | |
| // Сервер | |
| gulp.task('server', function () { | |
| browserSync({ | |
| port: 9000, | |
| server: { | |
| baseDir: 'app' | |
| } |
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
| <div class="wrapper"> | |
| <div class="main-content"> | |
| </div> | |
| </div> | |
| <footer class="page-footer"> | |
| </footer> | |
| /* прибьём футер к низу*/ | |
| .wrapper{ |
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
| .clearfix:before, | |
| .clearfix:after { | |
| content: " "; /* 1 */ | |
| display: table; /* 2 */ | |
| } | |
| .clearfix:after { | |
| clear: both; | |
| } |
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> | |
| <head> | |
| <title>BlondieCode. Лайфхаки программиста. Поиск с подстановкой.</title> | |
| <meta charset="utf-8"> | |
| <meta name="description" content="BlondieCode. Блог блондинки-программиста. Подписывайся. Здесь много интересного."> | |
| <meta name="keywords" content="BlondieCode, программирование"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style> |
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
| const fetch = require ('node-fetch') | |
| /*-----async function declaration with error handle------*/ | |
| async function fetchGithubUser(handle) { | |
| const url = `https://api.github.com/users/${handle}` | |
| const response = await fetch(url) | |
| const body = await response.json() | |
| if (response.status !== 200) |
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
| const Loader = () => ( | |
| <React.Fragment> | |
| <div id="loading" className="loaderStyle"> | |
| <div className="dot"></div> | |
| <div className="msg"></div> | |
| </div> | |
| </React.Fragment> | |
| ) |
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
| // connect() is a function that injects Redux-related props into your component. | |
| // You can inject data and callbacks that change that data by dispatching actions. | |
| function connect(mapStateToProps, mapDispatchToProps) { | |
| // It lets us inject component as the last step so people can use it as a decorator. | |
| // Generally you don't need to worry about it. | |
| return function (WrappedComponent) { | |
| // It returns a component | |
| return class extends React.Component { | |
| render() { | |
| return ( |
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
| #!/usr/bin/java --source 11 | |
| public class SomeClass { | |
| public static void main(String[] args) { | |
| System.out.println("Hello!"); | |
| } | |
| } | |
| /* | |
| To run do: | |
| $ chmod +x my-program |
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
| // Simple framework for timing concurrent execution | |
| public static long time(Executor executor, int concurrency, | |
| Runnable action) throws InterruptedException { | |
| CountDownLatch ready = new CountDownLatch(concurrency); | |
| CountDownLatch start = new CountDownLatch(1); | |
| CountDownLatch done = new CountDownLatch(concurrency); | |
| for (int i = 0; i < concurrency; i++) { | |
| executor.execute(() -> { | |
| ready.countDown(); // Tell timer we're ready | |
| try { |
OlderNewer