This file contains 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
Show hidden characters
{ | |
"compilerOptions": { | |
"jsx": "react", | |
"moduleResolution": "node", | |
"emitDecoratorMetadata": true, | |
"experimentalDecorators": true, | |
"esModuleInterop": true, | |
"allowSyntheticDefaultImports": true, | |
"target": "es2015", | |
"module": "esnext", |
This file contains 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 { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import PropTypes from 'prop-types'; | |
const modalRoot = document.getElementById('modal-root'); | |
// Let's create a Modal component that is an abstraction around | |
// the portal API. | |
class InPortal extends Component { | |
constructor(props) { |
This file contains 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 sleep(delay) { | |
var start = new Date().getTime(); | |
while (new Date().getTime() < start + delay); | |
} |
This file contains 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 getIosVersion = () => { | |
return [11, 3, 0]; | |
if (isIos()) { | |
const v = navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); | |
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || '0', 10)]; | |
} | |
}; | |
/** | |
* iosVersionToCheck is : string like '11' or '11.0' or (11.1.0), number like 10 or 11 or 9 |
This file contains 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 bredListRequest(resolve, reject) { | |
const r = new XMLHttpRequest(); | |
r.open('GET', 'https://api.github.com', true); | |
r.onerror = (e) => reject(e, 'error'); | |
r.onload = () => resolve(r.responseText); | |
r.send(); | |
} |
This file contains 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
/** | |
* service that emulates http | |
*/ | |
@Injectable() | |
export class TodoService { | |
readonly todos = [ | |
{id: 1, text: 'todo1', categoryId: 1}, | |
{id: 2, text: 'todo2', categoryId: 2}, | |
{id: 3, text: 'todo3', categoryId: 1}, |
This file contains 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
{"lastUpload":"2020-06-27T10:14:49.762Z","extensionVersion":"v3.4.3"} |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
<?php | |
$str = '1'; | |
echo sprintf("%04d", $str); | |
// Выводит "0001" | |
?> |
This file contains 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
app/Mage.php should look like: | |
public static function dispatchEvent($name, array $data = array()) | |
{ | |
// log event name | |
Mage::log($name, null, 'events.log', true); | |
Varien_Profiler::start('DISPATCH EVENT:'.$name); | |
$result = self::app()->dispatchEvent($name, $data); | |
#$result = self::registry('events')->dispatch($name, $data); |
NewerOlder