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 hexdump function | |
| # it's very similar to hexdump from Black Hat Python, but it runs on Python 3 | |
| def hexdump(src, length=16): | |
| result = [] | |
| digits = 2 | |
| for i in range(0, len(src), length): | |
| s = src[i:i+length] | |
| hexa = ' '.join(["%0*X" % (digits, ord(x)) for x in s]) |
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
| def divide(a): | |
| return a[:len(a)//2], a[len(a)//2:] | |
| def merge(a, b): | |
| result = [] | |
| while(True): | |
| if len(a) == 0: | |
| result += b |
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 win32clipboard | |
| def set_clipboard(text): | |
| win32clipboard.OpenClipboard() | |
| win32clipboard.EmptyClipboard() | |
| win32clipboard.SetClipboardText(text, win32clipboard.CF_UNICODETEXT) | |
| win32clipboard.CloseClipboard() |
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="store-card"> | |
| <a class="store-card__link" href="#"> | |
| <img | |
| class="store-card__image" | |
| src="https://duyt4h9nfnj50.cloudfront.net/resized/64aefca79e5d3f19540955e43e91126f-w550-bf.jpg" | |
| alt="" | |
| /> | |
| <h2 class="store-card__name">Il Patio</h2> | |
| <p class="store-card__order-info"> | |
| Заказ от |
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
| .store-card { | |
| margin-bottom: 48px; | |
| } | |
| .store-card__link { | |
| display: block; | |
| text-decoration: inherit; | |
| color: inherit; | |
| } | |
| .store-card__image { | |
| width: 100%; |
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 React from 'react'; | |
| import styled from 'styled-components'; | |
| const Link = styled.a` | |
| display: block; | |
| margin-bottom: 48px; | |
| text-decoration: inherit; | |
| color: inherit; | |
| `; |
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 currentUser = users.find(u => u.id === currentUserId); |
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
| try { | |
| return someUnsafeAction(); | |
| } catch (e) { | |
| console.error(e); | |
| return `Error: ${e.message}`; | |
| } |
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 (const a of actions) { | |
| watchers.push(yield createWatcher(a)) | |
| } |
OlderNewer