Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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 / gist:ee6027384d25a19b86d4
Created January 10, 2015 11:39
get integer complement
function getIntegerComplement( $n) {
$n = (int) $n;
$mask = bindec(str_repeat('1', strlen(decbin($n))));
$val = $n ^ $mask;
return $val;
}
@abidibo
abidibo / miniaturize-jquery.js
Last active August 29, 2015 14:14
responsive menu with bootstrap
// requires jquery
var abidibo = abidibo || {};
abidibo.menu = {};
// miniaturized menu
abidibo.menu.miniaturize = function(event) {
// ff mobile
window.scrollTo(0, 0);
@abidibo
abidibo / lightscribe
Last active August 29, 2015 14:14
lightscribe ubuntu 14.04
(http://reubuntu.blogspot.it/2014/02/lightscribe-e-una-tecnologia-di.html)
(http://stackoverflow.com/questions/23182765/how-to-install-ia32-libs-in-ubuntu-14-04-lts-trusty-tahr)
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
http://download.lightscribe.com/ls/lightscribe-1.18.8.1-linux-2.6-intel.deb
http://download.lightscribe.com/ls/lightscribeApplications-1.18.6.1-linux-2.6-intel.deb
https://www.lacie.com/download/drivers/LaCie%20LightScribe%20Labeler%201.0%20Linux.rpm (https://www.lacie.com/us/support/drivers/driver.htm?id=10061)