Skip to content

Instantly share code, notes, and snippets.

Avatar

Adrian Philipp adri

View GitHub Profile
View abtest_example
# This would be returned from a abtest-server and
# executed in mp.com on application load
# This code could be generated by a little webinterface or just be hardcoded for now
# singleton/static class
class Ab1GuestHeader extends MovieExplorer.AbTest
@name = "AB1: Guest Header"
@adri
adri / gist:3143450
Created Jul 19, 2012
Remove trailing whitespace in VIM
View gist:3143450
" Removes trailing spaces
function TrimWhiteSpace()
%s/\s*$//
''
:endfunction
autocmd FileWritePre * :call TrimWhiteSpace()
autocmd FileAppendPre * :call TrimWhiteSpace()
autocmd FilterWritePre * :call TrimWhiteSpace()
autocmd BufWritePre * :call TrimWhiteSpace()
View gist:3497597
class User
att_reader: username, email, newsletter
end
class UpdateUserEvent extends Event
attr_reader: sheldon_id, user
end
View gist:6947827
class TimeoutSoapClient extends SoapClient
{
const TIMEOUT = 20;
public function __doRequest($request, $location, $action, $version, $one_way = 0)
{
$url_parts = parse_url($location);
$host = $url_parts['host'];
$http_req = 'POST '.$location.' HTTP/1.0'."\r\n";
$http_req .= 'Host: '.$host."\r\n";
$http_req .= 'SoapAction: '.$action."\r\n";
@adri
adri / gist:8528349
Created Jan 20, 2014
Serialization of 'SimpleXMLElement' is not allowed' on OpenSuse 12.1
View gist:8528349
opensuse-121-x64:~/wsdl2phpgenerator(php-vcr-test-fixtures)]$ phpunit
PHPUnit 3.7.29 by Sebastian Bergmann.
Configuration read from /home/vagrant/wsdl2phpgenerator/phpunit.xml.dist
........................EEEEE
Time: 11.49 seconds, Memory: 11.75Mb
There were 5 errors:
@adri
adri / Cypher Query Examples
Last active Aug 29, 2015
Cypher queries used for a demo presentation at liip
View Cypher Query Examples
// ---------------------------------------------------------------
//// Loading data from CSV
// ---------------------------------------------------------------
CREATE CONSTRAINT ON (p:Person) ASSERT p.id IS UNIQUE;
CREATE CONSTRAINT ON (p:Person) ASSERT p.name IS UNIQUE;
LOAD CSV WITH HEADERS FROM "file:///Users/adri/Downloads/neo4j-community-2.1.0-M01/employees.csv" AS l
CREATE (p:Person { id: toInt(l.employee_id), name: l.employee_firstname + " " + l.employee_lastname});
CREATE CONSTRAINT ON (t:Tech) ASSERT t.id IS UNIQUE;
@adri
adri / oro_crm_install..log
Created Nov 1, 2014
OroCRM crm-application install error
View oro_crm_install..log
php app/console oro:install --env prod | tee install.log
Installing Oro Application.
Oro requirements check:
+---------+-------------------------------------------------------------------------------------------+
| Check | Mandatory requirements |
+---------+-------------------------------------------------------------------------------------------+
| OK | Vendor libraries must be installed |
| OK | app/cache/ directory must be writable |
| OK | app/logs/ directory must be writable |
View keybase.md

Keybase proof

I hereby claim:

  • I am adri on github.
  • I am adri (https://keybase.io/adri) on keybase.
  • I have a public key whose fingerprint is 4683 3F68 69B7 A5EF F35C 6905 75DF 53B4 DF53 EE21

To claim this, I am signing this object:

View hotreload.js
require("babel/register");
const dependencies = require('./src/dependencies');
var WebpackIsomorphicTools = require('webpack-isomorphic-tools');
var chokidar = require('chokidar');
var webpack = require('webpack');
var config = require('./config/webpack.config.dev');
var compiler = webpack(config);
var app = dependencies.expressApp;
var Mocha = require('mocha');
@adri
adri / config.yml
Last active Feb 15, 2017
Cache Doctrine metadata via opcache using DoctrineCacheBridge
View config.yml
framework:
cache:
pools:
app.cache.doctrine_metadata:
adapter: cache.adapter.php_files
doctrine:
orm:
entity_managers:
default: