This gist is about using a Multi-Tenancy strategy for your Doctrine entities.
See: https://gist.github.com/CarlosEduardo/aedfa640e3f7f22451686fb7e57228e3
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |
<application | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name"> | |
... | |
<provider |
This gist is about using a Multi-Tenancy strategy for your Doctrine entities.
See: https://gist.github.com/CarlosEduardo/aedfa640e3f7f22451686fb7e57228e3
Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.
I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a
beforeEach
. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern
that gives great defaults for each test example but allows every example to override props
when needed:
<?php | |
// Levenshtein distance with multibyte support | |
// Improved from https://gist.github.com/santhoshtr/1710925 | |
function mb_levenshtein($str1, $str2, $encoding = 'UTF-8', $return_lengths = false){ | |
$length1 = mb_strlen($str1, $encoding); | |
$length2 = mb_strlen($str2, $encoding); | |
if( $str1 === $str2) { | |
if ($return_lengths) { | |
return array(0, $length1, $length2); | |
} else { |
<?php | |
if (!function_exists('array_group_by')) { | |
/** | |
* Groups an array by a given key. | |
* | |
* Groups an array into arrays by a given key, or set of keys, shared between all array members. | |
* | |
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function. | |
* This variant allows $key to be closures. |
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- This file contains the mapping of keys (gamepad, remote, and keyboard) to actions within XBMC --> | |
<!-- The <global> section is a fall through - they will only be used if the button is not --> | |
<!-- used in the current window's section. Note that there is only handling --> | |
<!-- for a single action per button at this stage. --> | |
<!-- For joystick/gamepad configuration under linux/win32, see below as it differs from xbox --> | |
<!-- gamepads. --> | |
<!-- The format is: --> | |
<!-- <device> --> |
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
""" | |
GStreamer Tutorial 1: Simple Project | |
In this tutorial we will receive an mp3 file from our harddrive, manipulate | |
with an equalizer element, and output that to our speakers. | |
------------------------pipeline------------------------- | |
| | | | | |
<?php | |
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40 | |
class DumpHTTPRequestToFile { | |
public function execute($targetFile) { | |
$data = sprintf( | |
"%s %s %s\n\nHTTP headers:\n", | |
$_SERVER['REQUEST_METHOD'], | |
$_SERVER['REQUEST_URI'], | |
$_SERVER['SERVER_PROTOCOL'] |
<?php | |
/* module/Application/src/Application/I18n/DummyTranslator.php */ | |
namespace Application\I18n; | |
use Zend\I18n\Exception; | |
use Zend\I18n\Translator\Translator; | |
class DummyTranslator extends Translator |