Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| function maybe(value) { | |
| var obj = null; | |
| function isEmpty() { return value === undefined || value === null } | |
| function nonEmpty() { return !isEmpty() } | |
| obj = { | |
| map: function (f) { return isEmpty() ? obj : maybe(f(value)) }, | |
| getOrElse: function (n) { return isEmpty() ? n : value }, | |
| isEmpty: isEmpty, | |
| nonEmpty: nonEmpty | |
| } |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| var StateMachine = { | |
| // Register valid states for this object. | |
| __states__: { | |
| 'success': ['failure'], | |
| 'failure': ['success'] | |
| }, | |
| // Set initial state. | |
| __state__: 'success', |
This is only a summary. For a full list of changes see the NEWS file.
| Feature | RFC / announcement | Author |
|---|---|---|
| Bundled ZendOptimizer+ as OPcache | https://wiki.php.net/rfc/optimizerplus | zeev |
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import subprocess | |
| __all__ = ["transform"] | |
| __version__ = '0.3' | |
| __author__ = 'Christoph Burgmer <[email protected]>' | |
| __url__ = 'http://github.com/cburgmer/upsidedown' |
| Per https://code.google.com/p/v8/codesearch#v8/trunk/src/runtime.cc | |
| %CreateSymbol | |
| %CreatePrivateSymbol | |
| %CreateGlobalPrivateSymbol | |
| %NewSymbolWrapper | |
| %SymbolDescription | |
| %SymbolRegistry | |
| %SymbolIsPrivate |
| // This script will boot app.js with the number of workers | |
| // specified in WORKER_COUNT. | |
| // | |
| // The master will respond to SIGHUP, which will trigger | |
| // restarting all the workers and reloading the app. | |
| var cluster = require('cluster'); | |
| var workerCount = process.env.WORKER_COUNT || 2; | |
| // Defines what each worker needs to run |
| <script type="text/javascript"> | |
| (function () { | |
| "use strict"; | |
| // once cached, the css file is stored on the client forever unless | |
| // the URL below is changed. Any change will invalidate the cache | |
| var css_href = './index_files/web-fonts.css'; | |
| // a simple event handler wrapper | |
| function on(el, ev, callback) { | |
| if (el.addEventListener) { | |
| el.addEventListener(ev, callback, false); |
Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.
video::webkit-media-controls-timeline {
background-color: lime;
}
video /deep/ input[type=range] {##Погодное одностраничное веб-приложение
(!) Данные можно взять с сайта openweathermap.org или с любого другого сервиса.
(!) Обязательно использовать react.js и redux.
Приложение должно уметь: