Skip to content

Instantly share code, notes, and snippets.


Vladimir haltaction

  • Ukraine, Cherkasy
View GitHub Profile
View gist:1e3486dbe0e10b0e0c460551a93cdf77
- battary info
upower -i $(upower -e | grep 'BAT')
- restart audio
pulseaudio -k && sudo alsa force-reload
- search string in directory
grep -rnw '/path/to/somewhere/' -e 'pattern'
View js async examples
// 0 - synchronios call
function runSync() {
const end = + 3000;
while ( < end) {
const doSomethingHeavyInJavaScript = Math.random;
return 'task done';
View applications
ubuntu - apps
- Glipper, ClipIt - clipboard manager
- indicator-sensors - shows temperature in tray
- fusuma - customize touchpad gestues
-Arc-darker - theme
-hdajackretask - rewrite jack outputs on soundcard
View gist:25b0b020bb1c320efc2879c3181b1988
// all inputs
xinput --list --short
// property of secected by id=10
xinput --list-props "Logitech USB Receiver"
// set sensitivity
xinput set-prop 10 "Device Accel Constant Deceleration" 1.5
  1. Design the object model for a currency conversion library. Assume you're working for a bank which allows its clients to deposit money into their USD account. Customers have cash in different currencies and want to know the amount in USD which will be added to their account. You want to create a library for a widget which calculates the resulting amount in USD.
    UI looks like this:
[Currency name] [Amount] 
[Currency name] [Amount] 
[Resulting amount in USD] 
haltaction /
Created Mar 3, 2016 — forked from kamermans/
Build MySQL 5.1 on Ubuntu 12.04 and later (5.1 is not available in Ubuntu repo)
set -e
cd ~/
tar -zxf mysql-5.1.72.tar.gz
cd mysql-5.1.72
./configure '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-fast-mutexes' '--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--without-readline' '--with-ssl' '--without-docs' '--with-extra-charsets=all' '--with-plugins=max' '--with-embedded-server' '--with-embedded-privilege-control'
haltaction / script.js
Last active Feb 28, 2016 jq-selectors for remove static ads
View script.js
$('#contentInner > div[class^=b-]').remove();
$('.l-tab-item-content > div[class^=b-] > div:first').remove();
$('.l-content .b-nowviewed').prev().prev().remove();
$('.b-section-list > div[class^=b-]').not('.b-pager__wrap').remove();
haltaction / SearchService
Last active Feb 4, 2016
Symfony mongo search service
View SearchService
namespace CoreBundle\Service;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Query\Query;
class SearchService
private $dm;
haltaction / gist:7a12647ae6db6593a4f7
Last active Mar 14, 2021
Linux translate text in buffer
View gist:7a12647ae6db6593a4f7
1 - Устанавливаем обёртку над гугл транслейт
2 - Устанавливаем необходимые пакеты:
sudo apt-get install libnotify-bin xsel
3 - Создаём файл с именем sel-transl и копируем в него
#!/usr/bin/env bash
notify-send -u critical "$(xsel -o)" "$(xsel -o | trans -no-ansi -b :ru)"