These components have zero dependencies. They all require PHP > 5.3.3, but they can be integrated into projects without pulling in surprise dependencies. Some of them might not be terribly useful without a good binding component (e.g., DomCrawler and CSSSelector work best when using BrowserKit).
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 | |
namespace Core\Database; | |
use Logger; | |
use mysqli; | |
use Psr\Log\LoggerInterface; | |
/** | |
* Class MySQLiProxy |
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
export PATH=~/.composer/vendor/bin:$PATH | |
composer global require "squizlabs/php_codesniffer=*"; | |
# Check and Beautify | |
# - Ignore some commonly ignored things (composer folder, blade templates, ...) | |
phpcs ./ --ignore=test-reports,vendor,*.blade.php --standard=psr2,psr1 --report=summary | |
phpcbf ./ --ignore=test-reports,vendor,*.blade.php --standard=psr2,psr1 --report=summary | |
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
--- | |
- name: Install libfontconfig1 | |
apt: pkg=libfontconfig1 state=installed | |
- name: Download phantomjs | |
get_url: url=https://bitbucket.org/ariya/phantomjs/downloads/{{phantomjs.name}}.tar.bz2 dest=/usr/local/share/{{phantomjs.name}}.tar.bz2 validate_certs=no | |
- name: Unpack phantomjs | |
command: tar xvjf /usr/local/share/{{phantomjs.name}}.tar.bz2 -C /usr/local/share creates=/usr/local/share/{{phantomjs.name}} |
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
// declaration | |
function foo (n) { return n + 1; } | |
// expression | |
// note, fat arrow functions have very different meaning (usually what I want, though) | |
var foo = function (n) { return n + 1; }; | |
var foo = (n) => { return n + 1; }; | |
var foo = n => n + 1; | |
// object methods |
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 | |
class MontyHall | |
{ | |
const CAR = 'Car'; | |
const GOAT = 'Goat'; | |
public $doors; | |
public $choice; | |
public function __construct() |
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
# Example from http://mikepackdev.com/blog_posts/31-exhibit-vs-presenter | |
class Decorator < SimpleDelegator | |
end | |
class Car | |
def price | |
1_000_000 | |
end | |
end |
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 | |
namespace Acme\DemoBundle\Twig; | |
use Twig_Extension; | |
use Twig_Filter_Method; | |
class ChunkExtension extends \Twig_Extension | |
{ | |
public function getFilters() |
DEPRECATED
OlderNewer