Skip to content

Instantly share code, notes, and snippets.

Avatar
👻

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 = Date.now() + 3000;
while (Date.now() < 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
old
-Arc-darker - theme
-hdajackretask - rewrite jack outputs on soundcard
-screencloud
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
View sw-design-challenge.md
  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
haltaction / build_mysql51.sh
Created Mar 3, 2016 — forked from kamermans/build_mysql51.sh
Build MySQL 5.1 on Ubuntu 12.04 and later (5.1 is not available in Ubuntu repo)
View build_mysql51.sh
#!/bin/bash
set -e
cd ~/
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.72.tar.gz
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'
make
@haltaction
haltaction / script.js
Last active Feb 28, 2016
fs.to 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
haltaction / SearchService
Last active Feb 4, 2016
Symfony mongo search service
View SearchService
<?php
namespace CoreBundle\Service;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Query\Query;
class SearchService
{
private $dm;
@haltaction
haltaction / gist:7a12647ae6db6593a4f7
Last active Mar 14, 2021
Linux translate text in buffer
View gist:7a12647ae6db6593a4f7
1 - Устанавливаем обёртку над гугл транслейт
https://github.com/soimort/translate-shell
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)"