Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / utilities.md
Last active August 29, 2015 13:56
Utilities
@abidibo
abidibo / vifm_cheatsheet.md
Last active August 29, 2015 13:57
vifm cheatsheet

#Vifm

##Basic operations

###Files create a file

:touch filename   

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@abidibo
abidibo / main
Last active August 29, 2015 14:01
Starting a new python project
# Environment
(http://www.abidibo.net/blog/2012/04/30/deploy-django-applications-nginx-uwsgi-virtualenv-south-git-and-fabric-part-1/)
$ cd /var/www/
$ mkdir myproject
$ cd myproject
$ virtualenv --no-site-packages venv
$ source ./venv/bin/activate
$ pip install django
$ pip install South

NVIDIA OPTIMUS

Two graphic cards:
a typical platform includes both a lower-performance integrated unit by Intel and a high-performance one by Nvidia. Optimus should save battery life by automatically switching the power of the discrete graphics processing unit (GPU) off when it is not needed and switching it on when needed again.

Is this my case?

Run

$ lspci -vnn | grep '\''[030[02]\]'

00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09) (prog-if 00 [VGA controller])

@abidibo
abidibo / class.Image.php
Last active May 29, 2022 07:53
Image management class, php
<?php
/**
* @file class.Image.php
* @brief Contiene la classe Image per il trattamento di immagini
*
* @copyright 2014 Otto srl (http://www.opensource.org/licenses/mit-license.php) The MIT License
* @author abidibo [email protected]
*/
define('THUMBNAIL_DIR', CONTENT_DIR.OS.'thumbnail');