Skip to content

Instantly share code, notes, and snippets.

View pamil's full-sized avatar

Kamil Kokot pamil

View GitHub Profile
@pamil
pamil / sylius-11-12.diff
Last active June 11, 2018 14:39
Diff between Sylius/Sylius-Standard v1.1.x and Sylius/Sylius-Standard v1.2.0
diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..22bda1f
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,20 @@
+{
+ "presets": [
+ ["env", {
+ "targets": {
@pamil
pamil / magic-migrate
Created February 22, 2017 12:59
Given migrations A, B, C; database dump taken after migration B and no migration history, this script will either perform migration or add it manually until all of them are in migrations history
#!/usr/bin/env bash
while : ; do
output=$(bin/console doctrine:migrations:migrate --no-interaction 2> /dev/null)
status=$?
for version in $(echo "$output" | grep migrating | awk '{ print $3 }')
do
echo "Migrating to $version"
done
#!/usr/bin/env bash
if [ $# -ne 2 ]; then
echo "Usage: $0 [command] [listener command]"
exit 1
fi
pipe="/tmp/pipe-$(echo "$1" | md5sum)"
cleanup() {
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@pamil
pamil / github.css
Created July 12, 2016 08:45
Beautify GitHub
.issues-listing .Box-body-row .h3 {
font-size: 15px !important;
}
.label {
font-size: 11px !important;
}
body {
font-size: 13px !important;
[alias]
fhopr = "!f() { git fetch origin pull/$1/head:pull-request/$1; }; f"
fhupr = "!f() { git fetch upstream pull/$1/head:pull-request/$1; }; f"
doctrine:
orm:
entity_managers:
default:
metadata_cache_driver:
type: memcached
host: localhost
port: 11211
<?php
class CoreContext
{
private function iAmLoggedInAsRole($role, $email = 'sylius@example.com', array $authorizationRoles = array())
{
$user = $this->thereIsUser($email, 'sylius', $role, 'yes', null, array(), true, $authorizationRoles);
$token = new UsernamePasswordToken($user, $user->getPassword(), 'administration', $user->getRoles());
private function iAmLoggedInAsRole($role, $email = 'sylius@example.com', array $authorizationRoles = array())
{
$this->thereIsUser($email, 'sylius', $role, 'yes', null, array(), true, $authorizationRoles);
$this->getSession()->visit($this->generatePageUrl('sylius_user_security_login'));
$this->fillField('Email', $email);
$this->fillField('Password', 'sylius');
$this->pressButton('Login');
}
@pamil
pamil / gist:683d437d3fc553e2bdef
Created July 23, 2015 09:24
Editor > File and Code Templates > Includes > PHP Function Doc Comment
/**
${PARAM_DOC}
#if (${TYPE_HINT} != "void" && ${PARAM_DOC} != "") *
#end
#if (${TYPE_HINT} != "void") * @return ${TYPE_HINT}
#end
#if ((${TYPE_HINT} != "void" || ${PARAM_DOC} != "") && ${THROWS_DOC} != "") *
#end
${THROWS_DOC}
*/