Skip to content

Instantly share code, notes, and snippets.

View juliensnz's full-sized avatar
🕺

Julien Sanchez juliensnz

🕺
View GitHub Profile
@juliensnz
juliensnz / datagrid.yml
Last active August 29, 2015 13:56
Example for grid configuration
datagrid:
job-profile-grid: # grid name
options:
requireJSModules:
- pim/datagrid/state-listener
source: # data source
type: orm
query:
select:
- j.id
@juliensnz
juliensnz / ProductManager.php
Created June 10, 2014 08:37
ProductManager
<?php
namespace Pim\Bundle\CatalogBundle\Manager;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManager;
use Gedmo\Sluggable\Util\Urlizer;
use Pim\Bundle\CatalogBundle\Builder\ProductBuilder;
use Pim\Bundle\CatalogBundle\CatalogEvents;
use Pim\Bundle\CatalogBundle\Event\FilterProductEvent;
==> Downloading https://github.com/facebook/hhvm/archive/HHVM-3.2.0.tar.gz
/usr/bin/curl -fLA Homebrew 0.9.5 (Ruby 2.0.0-451; Mac OS X 10.9.4) https://github.com/facebook/hhvm/archive/HHVM-3.2.0.tar.gz -C 0 -o /Library/Caches/Homebrew/hhvm-3.2.0.tar.gz.incomplete
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 125 0 125 0 0 182 0 --:--:-- --:--:-- --:--:-- 182
0 0 0 16.4M 0 0 1850k 0 --:--:-- 0:00:09 --:--:-- 3233k
==> Verifying hhvm-3.2.0.tar.gz checksum
tar xf /Library/Caches/Homebrew/hhvm-3.2.0.tar.gz
==> Patching
patching file hphp/runtime/ext/gd/libgd/gdft.cpp
@font-face {
font-family: 'bullshit';
src: url('http://pixelambacht.nl/downloads/SansBullshitSans.ttf');
font-weight: normal;
font-style: normal;
}
* {
font-family: bullshit !important;
}
@juliensnz
juliensnz / Despot.php
Last active December 7, 2015 21:33
Simple php code to only run if no file are locked
<?php
/**
* Utility class to test if you can take a control over a locked file
*/
class Despot {
/**
* Try to take the control of a file
*/
public static function putsch($key)
@juliensnz
juliensnz / Sudoku.php
Last active March 9, 2016 22:17
Sudoku resolver and generator
<?php
namespace Sudoku;
/**
* Class to resolve and generate sudoku grids
*/
class Sudoku
{
/** Grid size */
<?php
$messages = [
[
'start' => '11:00', // Datetime
'end' => '14:00', // Datetime
'interval' => '10', // display every x minutes
'text' => 'top', // The text to display
'duration' => 2 // duration of the display in minute
],
durée journée = ((temps entre le dernier message de la journée) - (temps entre le premier message de la journée))
durée de tous les messages = somme(tous les messages);
interval moyen entre les messages = (durée journée - durée de tous les messages) / nombre de message;
avec ton exemple:
de 10h à 11h, je veux deux messages de 30 secondes toutes les 10 minutes.
durée journée = 11H - 10h
diff --git a/src/Pim/Bundle/EnrichBundle/Resources/public/js/product/field/multi-select-field.js b/src/Pim/Bundle/EnrichBundle/Resources/public/js/product/field/multi-select-field.js
index 189699d..1c37821 100644
--- a/src/Pim/Bundle/EnrichBundle/Resources/public/js/product/field/multi-select-field.js
+++ b/src/Pim/Bundle/EnrichBundle/Resources/public/js/product/field/multi-select-field.js
@@ -16,9 +16,10 @@ define(
'routing',
'pim/attribute-option/create',
'pim/security-context',
- 'pim/initselect2'
+ 'pim/initselect2',
@juliensnz
juliensnz / index.js
Last active March 6, 2018 09:58
Kata startup
const stdin = process.openStdin();
const promptMessage = (message = '') => process.stdout.write(`> ${message}`);
promptMessage();
stdin.addListener('data', userInput => {
promptMessage(userInput);
promptMessage();
});