Skip to content

Instantly share code, notes, and snippets.

@iwyg
iwyg / generate-webpack-manifest.js
Created June 5, 2018 14:09
Webpack manifest generator hook that includes dependent chunks
const getExtension = (file) => {
if (/\.css$/.test(file)) {
return 'css'
}
if (/\.js$/.test(file)) {
return 'js'
}
return 'asset'
}
@iwyg
iwyg / neos.dev.conf
Created September 25, 2014 13:11
nginx config for typo3 neos
server {
listen *:80;
server_name neos.dev;
root /var/www/neos/Web;
autoindex off;
access_log /var/log/nginx/neos.dev.access.log;
error_log /var/log/nginx/neos.dev.error.log;
index index.php index.html;
@iwyg
iwyg / DatabaseAwareTestTrait.php
Last active April 16, 2019 15:51
Mocking the database. Laravel Testing.
<?php
use \PDO;
use \Mockery as m;
use \Illuminate\Container\Container;
use \Illuminate\Database\DatabaseManager;
use \Illuminate\Database\Connectors\ConnectionFactory;
use \Illuminate\Database\Schema\Builder as SchemaBuilder;
trait DatabaseAwareTestTrait
@iwyg
iwyg / Config.php
Last active December 23, 2015 05:09
dot notation aware config class
<?php
/**
* This File is part of the Acme\Configuration package
*
* (c) Thomas Appel <[email protected]>
*
* For full copyright and license information, please refer to the LICENSE file
* that was distributed with this package.
*/
<?php
namespace Thapp\ControllerFactory;
use Illuminate\Container\Container;
/**
* Class: AbstractControllerFactory

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

<data>
<images>
<entry>
<image>myimage1.jpg</image>
</entry>
<entry>
<image>myimage2.jpg</image>
</entry>
<entry>
<image>myimage3.jpg</image>
@iwyg
iwyg / Rotator.js
Last active December 12, 2015 00:48
simple Backbone Slideview
(function (define) {
define(function (require) {
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
fx = require('modules/mod_animation'),
animators = {},
slidelock = {},
cachedItems = {},
<data>
<hello>paste your xml here</hello>
<emptynode></emptynode>
<entry>A</entry>
<entry>B</entry>
</data>
<data>
<pants>
<entry>
<content>Test 1</content>
</entry>
<entry>
<content>Test 2</content>
</entry>
<entry>
<content>Test 3</content>