Skip to content

Instantly share code, notes, and snippets.

@abidibo
abidibo / awrgui.py
Last active December 29, 2015 07:39
awrgui
#! /usr/bin/python
from gi.repository import Gtk, Gdk, GObject
from agtk import MainWindow
"""
@brief AWR Graphic User Interface
"""
class AWRGUI:
"""
@brief Constructor
@abidibo
abidibo / agtk.py
Last active December 29, 2015 02:58
agtk
#! /usr/bin/python
"""
AGTKS (abidibo's GTK library)
This library containes reusable GTK classes.
@author abidibo (Stefano Contini) <[email protected]>
@license MIT License (http://opensource.org/licenses/MIT)
@date 2013
"""
from gi.repository import Gtk, Gdk
@abidibo
abidibo / mselect-to-mcheckbox.css
Last active March 24, 2021 13:40
Library to substitute the multiple select widget with a multiple checkbox in django admin
.mcheckbox-container {
display: inline-block;
vertical-align: middle;
height: 160px;
overflow: auto;
}
.mcheckbox-table {
margin-right: 20px;
width: 100%;
}
@abidibo
abidibo / path.js
Created March 28, 2013 11:09
Reverse selector engineering. Get css selector from element. Works with browsers implementing the :nth-of-type selector. Requires mootools selectors.
// requires mootools selectors
var path = function path(element) {
if(element.get('id')) {
return '#' + element.get('id');
}
if(element == document.body) {
return 'body';
@abidibo
abidibo / cache.php
Last active December 15, 2015 00:18
A class to manage the caching of html outputs and data structures
<?php
/**
* @file cache.php
* @brief Contains the \ref cache, outputCache and dataCache classes.
*
* @author abidibo [email protected]
* @version 0.99
* @date 2011-2012
* @copyright Otto srl [MIT License](http://www.opensource.org/licenses/mit-license.php)
*/
@abidibo
abidibo / time_graph_canvas.js
Last active December 12, 2015 04:38
This is a mootools class which permits to draw a temporal graph over a canvas. Features: - grid system (different steps on tx and y axis) - scale factor different for both axis - x axis (time) discrete - y axis continuous - can't draw in the past, always growing x - maybe more...
// new namespace
var tcg = {};
// main graph controller
tcg.graph = new Class({
options: {
x_grid_step: 20, // grid step in px on x axis
y_grid_step: 40, // grid step in px on y axis
x_factor: 1, // multiplier factor of each grid step on x axis (value = m * grid-steps)
@abidibo
abidibo / mootab.css
Last active December 11, 2015 22:58
A mootools class to create a tab structure. js and css included.
.mootab .tab_contents {
border: 1px solid #eee;
padding: 10px;
}
.mootab .tab_titles .link {
cursor: pointer;
display: inline-block;
border:1px solid #eee;
border-bottom-width: 0;
padding: 2px 5px;
@abidibo
abidibo / APE SERVER configuration
Last active December 11, 2015 07:18
Configuration of APE SERVER, 2 machines, 1 serevr and 1 client
GENERAL
=================
Two machines, 1 server and 1 client
The backoffice and frontend applications resides on the server
SERVER
=================
Suppose the server ip on the local netw is 192.168.0.74
ls -la /var/ape
@abidibo
abidibo / accessibilità
Created December 5, 2012 09:07
Accessibilità Gino solo testo/altocontrasto/grafica
**in topBar phpModuleView**
=================================
$encode = true;
if($_SERVER['REQUEST_URI'] == '/index.php') {
$ubase = $_SERVER['REQUEST_URI']."?textview=";
$encode = false;
}
elseif(substr($_SERVER['SCRIPT_URL'], -1) == '/') {
$ubase = $_SERVER['REQUEST_URI']."?";
}
@abidibo
abidibo / fp_ipad_fix.js
Created March 19, 2012 16:13
Bug fix for flowplayer ipad
video.fp_setPlaylist = function(playlist) {
log("Setting playlist");
activeIndex = 0;
for ( var i = 0; i < playlist.length; i++ ) {
if(typeof playlist[i].url != 'undefined') playlist[i] = fixClip(playlist[i]);
}
activePlaylist = playlist;
// keep flowplayer.js in sync