##Погодное одностраничное веб-приложение
(!) Данные можно взять с сайта openweathermap.org или с любого другого сервиса.
(!) Обязательно использовать react.js и redux.
Приложение должно уметь:
- Добавлять/удалять города
- Сохранять локально данные
| // the main app file | |
| import express from "express"; | |
| import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
| import authenticate from "./authentication"; // middleware for doing authentication | |
| import permit from "./authorization"; // middleware for checking if user's role is permitted to make request | |
| const app = express(), | |
| api = express.Router(); | |
| // first middleware will setup db connection |
##Погодное одностраничное веб-приложение
(!) Данные можно взять с сайта openweathermap.org или с любого другого сервиса.
(!) Обязательно использовать react.js и redux.
Приложение должно уметь:
| var uniqueArray = function(arrArg) { | |
| return arrArg.filter(function(elem, pos,arr) { | |
| return arr.indexOf(elem) == pos; | |
| }); | |
| }; | |
| var uniqEs6 = (arrArg) => { | |
| return arrArg.filter((elem, pos, arr) => { | |
| return arr.indexOf(elem) == pos; | |
| }); |
| #!/usr/bin/env python2 | |
| import SimpleHTTPServer | |
| import SocketServer | |
| import logging | |
| PORT = 8000 | |
| class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): |
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
| #!/usr/bin/python3 | |
| # By Steve Hanov, 2011. Released to the public domain. | |
| # Please see http://stevehanov.ca/blog/index.php?id=115 for the accompanying article. | |
| # | |
| # Based on Daciuk, Jan, et al. "Incremental construction of minimal acyclic finite-state automata." | |
| # Computational linguistics 26.1 (2000): 3-16. | |
| # | |
| # Updated 2014 to use DAWG as a mapping; see | |
| # Kowaltowski, T.; CL. Lucchesi (1993), "Applications of finite automata representing large vocabularies", | |
| # Software-Practice and Experience 1993 |
| var array = [{},{},{}]; | |
| var copy = _.map(array, _.clone); |
| var dom = Bloop.dom; | |
| var Box = Bloop.createClass({ | |
| getInitialState: function() { | |
| return { number: 0 }; | |
| }, | |
| updateNumber: function() { | |
| this.state.number++; | |
| }, |
| (function() { | |
| // Do not use this library. This is just a fun example to prove a | |
| // point. | |
| var Bloop = window.Bloop = {}; | |
| var mountId = 0; | |
| function newMountId() { | |
| return mountId++; | |
| } |
| #!/usr/bin/env python2 | |
| """ | |
| Author: takeshix <[email protected]> | |
| PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]). | |
| Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP. | |
| """ | |
| import sys,struct,socket | |
| from argparse import ArgumentParser |