(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.
# http://stackoverflow.com/a/646643 | |
String::startsWith ?= (s) -> @slice(0, s.length) == s | |
String::endsWith ?= (s) -> s == '' or @slice(-s.length) == s |
<?php | |
namespace App\Listeners; | |
use Kdyby\Events\Annotations as Event; | |
/** | |
* @Event\Subscriber([<class>]) | |
* <class> is set as default for all handlers |
#!/bin/bash | |
echo "Deploy launched." | |
# fetch new version | |
git fetch origin | |
# check for changes | |
CHANGES=$(git status -s) |
<?php | |
namespace Kdyby\Doctrine\Console; | |
use Kdyby; | |
use Kdyby\Doctrine\BatchImportException; | |
use Kdyby\Doctrine\Helpers; | |
use Rixxi; | |
use Symfony; |
(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.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
#!/bin/bash | |
dir=$(mktemp -d) | |
old=$1 | |
new=$2 | |
git clone "$old" "$dir" | |
cd "$dir" | |
git remote add new "$new" | |
git push -u new master |
case class Segment(hash: Int, str: String) | |
sealed trait DiffGroup | |
case class NewLine(str: String) extends DiffGroup | |
case class Diffs(diffs: Seq[Diff]) extends DiffGroup | |
sealed trait Diff { def pos: Int } | |
case class Addition(pos: Int, str: String) extends Diff | |
case class Deletion(pos: Int, len: Int) extends Diff |