##Погодное одностраничное веб-приложение
(!) Данные можно взять с сайта openweathermap.org или с любого другого сервиса.
(!) Обязательно использовать react.js и redux.
Приложение должно уметь:
- Добавлять/удалять города
- Сохранять локально данные
| #!/usr/bin/env python2 | |
| import SimpleHTTPServer | |
| import SocketServer | |
| import logging | |
| PORT = 8000 | |
| class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): |
| 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; | |
| }); |
##Погодное одностраничное веб-приложение
(!) Данные можно взять с сайта 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 |
| # build wine Docker image | |
| pushd wine; docker build -t wine .; popd | |
| # build x11 Docker image for IDA | |
| pushd ida; docker build -t wine/ida .; popd | |
| # demonstrate x11 forwarding works | |
| docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix wine/ida xclock | |
| # interactive shell in container |
| import * as models from "models"; | |
| import Sequelize from "sequelize"; | |
| import fs from "fs"; | |
| delete models.default; | |
| const sequelize = new Sequelize( | |
| '', | |
| '', | |
| '', { |
| .PHONY: clean distclean install run | |
| ENV ?= env | |
| VENV = $(shell python -c "import sys; print(int(hasattr(sys, 'real_prefix')));") | |
| ifeq ($(VENV),1) | |
| GUNICORN = gunicorn | |
| else | |
| GUNICORN = $(ENV)/bin/gunicorn | |
| endif |
| import string | |
| def hexdump(src, length=16, sep='.'): | |
| DISPLAY = string.digits + string.letters + string.punctuation | |
| FILTER = ''.join(((x if x in DISPLAY else '.') for x in map(chr, range(256)))) | |
| lines = [] | |
| for c in xrange(0, len(src), length): | |
| chars = src[c:c+length] | |
| hex = ' '.join(["%02x" % ord(x) for x in chars]) | |
| if len(hex) > 24: |
| #region Win10IoT Audit Code | |
| $CimSession = New-CimSession -ComputerName Win10IoT -Credential Administrator -Authentication Negotiate | |
| Get-CimInstance -ClassName Win32_OperatingSystem -CimSession $CimSession | |
| Get-CimInstance -ClassName Win32_Service -Filter 'Name = "InputService"' -CimSession $CimSession | Format-List * | |
| # Run the service audit function in CimSweep | |
| $ServicePermissions = Get-CSVulnerableServicePermission -CimSession $CimSession | |
| $ServicePermissions | Where-Object { $_.GroupName -eq 'NT AUTHORITY\Authenticated Users' } | |
| # The fact that Authenticated Users can change the service configuration means that |
| import React, { Component } from 'react' | |
| import { Link } from 'react-router' | |
| // Drag and Drop | |
| import { DragDropContext } from 'react-dnd' | |
| import HTML5Backend from 'react-dnd-html5-backend' | |
| // Material UI | |
| import { List } from 'material-ui/List' | |
| import Subheader from 'material-ui/Subheader' | |
| class ReorderableList extends Component { |