(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| body { | |
| background-color: deepskyblue; | |
| padding: 10px; | |
| } | |
| div.sunholder { | |
| display: inline-block; | |
| animation: spin 8s linear 0s infinite; | |
| } | |
| div.sun { | |
| display: block; |
| <?php | |
| // finds the last URL segment | |
| $urlArray = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
| $segments = explode('/', $urlArray); | |
| $numSegments = count($segments); | |
| $currentSegment = $segments[$numSegments - 1]; | |
| ?> | |
| <?php if ( $currentSegment == "index.php" ) { ?>active<?php } ?> |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /** | |
| * IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | |
| * | |
| * @param string url | |
| * @param object callback | |
| * @param mixed data | |
| * @param null x | |
| */ | |
| function ajax(url, callback, data, x) { | |
| try { |
| git rebase --interactive HEAD~2 | |
| # we are going to squash c into b | |
| pick b76d157 b | |
| pick a931ac7 c | |
| # squash c into b | |
| pick b76d157 b | |
| s a931ac7 c |
| (function () { | |
| // IndexedDB | |
| var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB, | |
| IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction, | |
| dbVersion = 1.0; | |
| // Create/open database | |
| var request = indexedDB.open("elephantFiles", dbVersion), | |
| db, | |
| createObjectStore = function (dataBase) { |
| function Promise() { | |
| var callbacks = [], | |
| promise = { | |
| resolve: resolve, | |
| reject: reject, | |
| then: then, | |
| safe: { | |
| then: function safeThen(resolve, reject) { | |
| promise.then(resolve, reject); | |
| } |