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 z = +new Date(); | |
| for( var j = 0; j < 100; j++ ){ | |
| var elements = []; | |
| for( var i = 0; i < 1000; i++ ) | |
| elements.push( | |
| <div key={i} className="row"> | |
| <div className="col">a</div> | |
| <div className="col">b</div> |
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
| @attributes({ | |
| typeless : void 0, | |
| num : 5, | |
| s : "dsdsds", | |
| count : Number.has.toJSON( false ) | |
| }) | |
| class MyModel { | |
| doSomething(){ | |
| //... | |
| } |
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 keys = [], | |
| attrs = {}, | |
| c = []; | |
| for( var i = 0; i < 20; i++ ){ | |
| keys.push( 'a' + i ); | |
| attrs[ 'a' + i ] = i; | |
| c.push( 'a.a' + i + '=== void 0 || f( a.a' + i + ');') | |
| } |
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 match( obj ){ | |
| return function( x ){ | |
| for( var name in obj ){ | |
| if( x.get( name ) !== obj[ name ] ){ | |
| return false; | |
| } | |
| } | |
| return true; | |
| } |
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 State1( a, b ){ | |
| this.a = a; | |
| this.b = b; | |
| } | |
| State1.prototype.msgType1 = function( c, d ){ | |
| return new State2( this.a + 1 ); | |
| } | |
| State1.prototype.msgType2 = function( d ){ |
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 devToolsHook = window && window.__REACT_DEV_TOOLS_HOOK__; | |
| if( devToolsHook ){ | |
| const { addInnerStateInspector } = devToolsHook; | |
| if( addInnerStateInspector ){ | |
| const showAsArray = x => x.toArray(), | |
| showAsObject = x => x.toObject(); | |
| addInnerStateInspector( List, showAsArray ); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"/> | |
| <title>Population of the array</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
| <script src="./suite.js"></script> | |
| </head> | |
| <body> | |
| <h1>Open the console to view the results</h1> |
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 digitsStr = | |
| // 0 8 16 24 32 40 48 56 63 | |
| // v v v v v v v v v | |
| "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-"; | |
| var digits = digitsStr.split(''), | |
| codes = digits.map( x => x.charCodeAt( 0 ) ); | |
| function base64id( int32 ){ | |
| const a = digits[int32 & 0x3f]; | |
| int32 >>>= 6; |
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 * as React from 'react' | |
| class AddUser extends React.Component { | |
| state = { | |
| name : '', | |
| email : '', | |
| isActive : true | |
| } | |
| onSubmit = e => { /* submit form logic */ } |
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
| render(){ | |
| const { state } = this; | |
| return ( | |
| <form onSubmit={ this.onSubmit }> | |
| <label> Name: | |
| <input type="text" value={ state.name } /> | |
| </label> | |
| <label> Email: | |
| <input type="text" value={ state.email } /> |
OlderNewer