Skip to content

Instantly share code, notes, and snippets.

View jorisros's full-sized avatar
⌨️
Brewing code

Joris Ros jorisros

⌨️
Brewing code
View GitHub Profile
[
{
"id": "ab156e4d-d982-4b62-a45d-1644e53d07ab",
"name": "entity_simple",
"label": "Entity simple",
"fields": [
{
"id": "5b1e3c22-ef8d-462a-ae43-f0e19157677a",
"name": "field_a",
"label": "Field A",
@jorisros
jorisros / gist:2b58c291b62494c400a6a93a29763793
Created August 26, 2019 08:46 — forked from mre/gist:64672c481f8f1232d468e3e7169f4f77
Make a change in a composer vendor folder and push to branch
# Go into the directory of the vendor package that you changed
cd vendor/<owner>/<package>
# Create a new git repository (composer does not check out the full git repo by default. Only a sparse copy)
git init
# Create a new branch for your local changes
git checkout -b branchname
# Commit changes
@jorisros
jorisros / workflow.yml
Last active January 25, 2019 09:40
Sample of a workflow
pimcore:
workflows:
simple_workflow:
enabled: true
priority: 1
label: 'Simple workflow'
initial_place: null
type: workflow
audit_trail:
enabled: true
@jorisros
jorisros / commands.md
Created May 14, 2018 12:42 — forked from ondrej-kvasnovsky/commands.md
Commands to install and configure ElasticSearch on Ubuntu

Install ElasticSearch and Java

1  wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2  sudo dpkg -i elasticsearch-1.0.1.deb
3  sudo update-rc.d elasticsearch defaults 95 10
4  sudo add-apt-repository ppa:webupd8team/java
5  sudo apt-get update
6  sudo apt-get install oracle-java7-installer
7  java -version
#!/bin/sh
curl "http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.23-osx10.9-x86_64.tar.gz" -o "mysql-5.6.23-osx10.9-x86_64.tar.gz"
tar xfvz mysql-5.6*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@jorisros
jorisros / gist:4fa6c5478ad2bb029a75
Created May 11, 2015 10:16
example vhost config for logging acces after a nginx proxy
<VirtualHost *:80>
#domain settings
DocumentRoot /home/user/sites/domain.net/public_html
ServerName domain.net
ServerAlias www.domain.net
#Setting the log format and location of the files
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
@jorisros
jorisros / gist:6f8cd30f9107e88be773
Last active August 29, 2015 14:18
Convert virtualbox to vmware

The correct solution to this is to export as ovf v1 either from the UI, or when running an export from the command line it appears to default to v1.

vboxmanage import futsy-v2.ova

A vm's name can be different than the OVA name

vboxmanage list vms
@jorisros
jorisros / gist:ac83ca2b53e3fe3ed233
Created November 6, 2014 09:30
Example phpexcel read data
//var_dump();
require_once(sfConfig::get('sf_root_dir').'/vendor/phpexcel/PHPExcel.php');
//$php\
$values = $this->getValues();
$id = uniqid();
$file = sfConfig::get('sf_root_dir').'/data/upload/'.$id.'.xlsx';
move_uploaded_file($values['file']->getTempName(), $file);
$objPHPExcel = PHPExcel_IOFactory::load($file);
$lastRowNumber = (int)$objPHPExcel->getActiveSheet()->getHighestRow();
@jorisros
jorisros / gist:54f9578eb932b8378db0
Created September 11, 2014 09:16
Zipcode (dutch notation: 1234AB)
$("#zipcode").keydown(function (e) {
var correction = 0;
if (e.which >= 96 && e.which <= 105) {
correction = 48;
}
var char = String.fromCharCode(e.which - correction);
var value = $("#zipcode").val();
@jorisros
jorisros / sfWidgetFormInputFileWithPreview.class.php
Last active August 29, 2015 14:05
Simple class to get a preview above the upload button if file is already uploaded
<?php
/**
* Required plugin
* https://github.com/aalbagarcia/sfThumbnailPlugin
*/
/**
* Class sfWidgetFormInputFileWithPreview
*