Skip to content

Instantly share code, notes, and snippets.

@PEM-FR
PEM-FR / RFC-DHZM.md
Created October 17, 2012 07:38
RFC - Decision Helper for ZF2 Modules

RFC Status: Work-in-Progress

@PEM-FR
PEM-FR / joystick_chanson_remy
Last active September 19, 2021 20:24
Joystick - La chanson de Rémy
Vidéo and song here : https://www.youtube.com/watch?v=wEZ-KUNV-z8
Lyrics :
Dans la solitude,
De ta chambre moche,
Un jour on viendra, pour chanter...
Ce s'ra peut-être,
ton jour... de chance,
@PEM-FR
PEM-FR / meeting_summary.py
Created September 7, 2012 18:37
meeting summary module for phenny
#!/usr/bin/env python
"""
meeting_summary.py - Phenny meeting_summary Module
"""
import datetime as dt
from tools import deprecated
startTime = 0
stopTime = 0
@PEM-FR
PEM-FR / lolcatz.php
Created June 28, 2012 08:49
dep injection
protected $_serviceFactory;
/**
*You can inject a mock factory here for unit testing
*
*/
public function setServiceFactory(ServiceFactory $serviceFactory)
{
$this->_serviceFactory = $serviceFactory;
}
@PEM-FR
PEM-FR / biasedMonty.php
Created October 28, 2011 14:17
biasedMonty
<?php
$results = array();
$wrongs = array();
for ($i = 0; $i < 100000; $i++) {
$result[$i] = mt_rand(1,3);
$wrongs[$i][0] = ($result[$i] - 1 == 0) ? 3 : $result[$i] - 1;
$wrongs[$i][1] = 6 - $result[$i] - $wrongs[$i][0];
}
@PEM-FR
PEM-FR / unCacheItem.js
Created September 22, 2011 14:12
A function to clean an item from a dojox.data.JsonRestStore without sending a delete req to the server
unCacheItem: function(item){
// summary:
// deletes item and any references to that item from the store.
// No request will be issued serverside
// extend dojox.data.JRS, and put this function in
// item:
// item to delete
//
// If the desire is to delete only one reference, unsetAttribute or
@PEM-FR
PEM-FR / onStyleRow.js
Created July 15, 2011 10:35
example of onStyleRow
styleRow : function (inRow){
with(inRow){
customStyles += " color: orange;";
dojox.grid.DataGrid.prototype.onStyleRow.apply(this.grid, arguments); // here the function is called through a hitch, hence this.grid
}
},
@PEM-FR
PEM-FR / gist:1044970
Created June 24, 2011 15:07
Find and select the tab of a TabContainer parent of currentWidget
// this, is the tabContainer
findAndSelectTab : function(currentWidget){
var tabContainerId = this.get('id');
var parent = null;
var tab = null;
if(undefined != currentWidget.getParent
&& undefined != typeof(currentWidget.getParent())){
parent = currentWidget.getParent();
}else{
@PEM-FR
PEM-FR / hex_color_generator.js
Created May 20, 2011 14:36
Hex color generator
dojo.style(
zone,
"border",
"2px solid #" + ("00000"+(Math.random()*16777216<<0).toString(16)).substr(-6)
);
@PEM-FR
PEM-FR / Grid_connect_on_Row_Clicks.js
Created April 5, 2011 09:11
Grid connect on Row Clicks
this.connect(
this.someGrid,
"onRowDblClick",
this,
function(e){
var grid = this.someGrid;
var rowIndex = grid.selection.selectedIndex;
var myStoreItem = grid.getItem(rowIndex);
this.someCallbackFunction(myStoreItem);
}