Skip to content

Instantly share code, notes, and snippets.

@tux-00
tux-00 / cancel_commit.md
Last active March 20, 2017 13:04
Cancel a specific commit

Revert one commit

git revert {sha}

Revert commit x to y

git revert {sha}..{sha}

@tux-00
tux-00 / bumblebee_dual_screen_bug.md
Last active March 20, 2017 13:00
How to fix Bumblebee dual screen bug
@tux-00
tux-00 / disable_mouse_accel.md
Last active March 20, 2017 12:55
Disable mouse acceleration
xset m default
@tux-00
tux-00 / emu_1212m_drivers.md
Last active March 20, 2017 12:57
Install EMU 1212m drivers on Linux (Fedora)
dnf install alsa-firmware
shutdown -r now
@tux-00
tux-00 / gist:9508092
Last active September 10, 2015 15:19
Format bytes to kb Mb Gb or Tb automaticaly.
<?php
function formatBytes($size, $precision = 2)
{
if($size== 0) {
return 0;
}
$base = log($size) / log(1024);
$suffixes = array('o', 'kb', 'Mb', 'Gb', 'Tb');
return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];