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 Avatar = ({ src }) => <img width="100px" height="100px" src={src}/> | |
class AvatarComponent extends React.Component { | |
render() { | |
return <img width="100px" height="100px" src={this.props.src}/> | |
} | |
} | |
class User extends React.Component { | |
render() { | |
const src = "https://api.adorable.io/avatars/285/[email protected]" | |
const avatars = Array(500).fill(0).map(() => { |
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
// editable. data in form | |
const editableDataSourceSelector = createSelector(getFormValues('budget', 'budgetitems'), items => [{ids: items.map(item => item.get('id'))}]) | |
const editableRowDataSelector = rowId => createSelector(getFormValues('budget', 'budgetitems'), items => items.get(items.findIndex(item => item.get('id') === rowId))) | |
// readonly - data in application section | |
const readDataSourceSelector = createSelector(getSectionData('budget'), ({budgetItems: items}) => [{ids: items.map(item => item.id)}]) | |
const readRowDataSelector = rowId => createSelector(getFormValues(getSectionData('budget'), data => find(data.budgetItems, {id: rowId})) |
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 URI = process.argv[2], | |
TEST_ID = new Date().getTime(), | |
SOCKET_INTERVAL = 0, | |
MAX_SOCKETS = 5000, | |
WARM_UP_SOCKETS = 10, | |
MESSAGE_PADDING_SIZE = 2000, | |
MESSAGE_SIZE_BASE = 41, | |
ADD_RESULT_DOMAIN = "lonlx10557.nomura.com", | |
ADD_RESULT_PORT = 80, | |
ADD_RESULT_PATH = "/streamtest/add_result.php", |
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 bruteforceWaitForWebfonts(fonts, callback) { | |
var loadedFonts = 0; | |
const onceCallback = once(callback) | |
for (var i = 0, l = fonts.length; i < l; ++i) { | |
(function ({fontFamily, fontWeight}) { | |
var node = document.createElement('span'); | |
// Characters that vary significantly among different fonts | |
node.innerHTML = 'giItT1WQy@!-/#'; | |
// Visible - so we can measure it - but not on the screen |
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 Foundation | |
import RxSwift | |
import GoogleSignIn | |
import RxViewModel | |
import RxCocoa | |
import RealmSwift | |
class InboxDetailViewModel: RxViewModel { | |
// Input | |
struct Input { |
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 _ from 'lodash'; | |
import B, {promisifyAll} from 'bluebird'; | |
import {Log, trace} from '@synccloud/logging'; | |
import {assertType} from '@synccloud/utils'; | |
import {HtmlConverter, Markup, StripBlockquoteHandler} from '@synccloud/mime-letter-markup'; | |
import {serializeDate, deserializeDate} from './date-convertor.es6'; | |
import {MailParser} from 'mailparser'; | |
import s3Stream from 's3-upload-stream'; | |
import {S3} from 'aws-sdk'; | |
import streamLength from 'length-stream'; |
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
_sendToServer: function (data) { | |
var quotedPart = '', | |
user = getCurrentUser(), | |
shouldRemoveParticipantIfFail, | |
lastMessage; | |
if (this.emailModel.get('messages').length ) { | |
// сообщения отсортированы в обратном порядке, самый последний – в начале | |
lastMessage = this.emailModel.get('messages').find(function (m) { | |
return !!m.id; |
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
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes | |
# 1gb => 1024*1024*1024 bytes | |
# |
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
#!/bin/bash | |
set -x | |
export DEBIAN_FRONTEND=noninteractive | |
curl -SsL https://get.docker.com/ | sudo sh | |
sudo usermod -aG docker sc | |
sudo curl -L https://github.com/docker/compose/releases/download/1.6.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose |