Skip to content

Instantly share code, notes, and snippets.

View mente's full-sized avatar

Alex Vasilenko mente

View GitHub Profile
@mente
mente / prophecy-reproduce.php
Created October 18, 2016 20:24
Reproduce of phpunit not asserting expectations of prophecy mocks created in data provider
<?php
class RandomClassWithMock
{
public function methodToMock()
{
return 42;
}
}
@mente
mente / igbinary_reproduce.php
Last active October 6, 2016 18:02
igbinary segfault reproduce on php7
<?php
$result = [];
for ($i = 0; $i < 40; $i++) {
$inner = new stdClass;
$inner->a = $i % 25;
$result[0][$inner->a][$i] = $inner;
$result[1][] = $inner;
}
@mente
mente / _script.php
Created July 13, 2015 14:37
Testing "array soft-copy" in PHP5.6
<?php
$byValue = function (array $value) {
$z = $value[2];
};
$byValueWrite = function (array $value) {
$value[] = 1;
array_pop($value);
};
@mente
mente / config.log
Created January 27, 2015 00:43
drbd-utils 8.9.2rc2 compilation
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by DRBD configure 8.9.2rc2, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ ./configure --prefix=/usr --without-83support --with-pacemaker
## --------- ##
## Platform. ##
#Table
CREATE TABLE `departments` (
`in` int(11) unsigned NOT NULL,
`out` int(11) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
#Via JOIN
SELECT i.count + o.count as total, i.in
FROM
(
@mente
mente / require-config.js
Created October 13, 2014 08:04
PhpStorm 8.0.1 require.js error
require.config({
waitSeconds: 15,
baseUrl: '/js',
paths: {
templates: '../templates',
knockout: 'libs/knockout',
'jquery.ui.widget': 'libs/ui/widget',
'jquery.ui.sortable': 'libs/ui/sortable',
core: 'libs/ui/core',
mouse: 'libs/ui/mouse',
@mente
mente / gist:08db44fc28f1d94ed44c
Created October 8, 2014 08:01
Failed Octave compilation on Mavericks 10.9.5
This file has been truncated, but you can view the full file.
Warning: No Fortran optimization information was provided. You may want to consider
setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to
`brew install` if your compiler is compatible with GCC.
If you like the default optimization level of your compiler, ignore this
warning.
Warning: No Fortran optimization information was provided. You may want to consider
setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to
`brew install` if your compiler is compatible with GCC.
@mente
mente / check-dex-methods.sh
Last active August 29, 2015 13:59
calculate total number of methods in dex files
#!/usr/bin/env sh
dxPath="/Applications/Android Studio.app/sdk/build-tools/android-4.4/dx"
jarDir=build/pre-dexed/debug
rm temp.dex
sum=0
line='-----------------------------------------------------------------------------------------------------------------------'
for file in $jarDir/*.jar; do
"$dxPath" --dex --output=temp.dex $file
@mente
mente / build.gradle
Created November 14, 2013 10:27
Example of using support v4 library with android gradle plugin
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:+'
}
}
android {
defaultConfig {
versionName "actionbar"
}
signingConfigs {
release {
storeFile file("android.keystore")
...
}
}