Skip to content

Instantly share code, notes, and snippets.

View boo1ean's full-sized avatar
🎯
Focusing

Egor Gumenyuk boo1ean

🎯
Focusing
View GitHub Profile

db: postgres

table cols: timestamp, userId, event { 'in', 'out' }

The report should be:

for given time range (startDate, endDate)

grouped by period (day, week, month)

@boo1ean
boo1ean / manjaro-change-default-browser.md
Created April 15, 2019 16:45
manjaro-change-default-browser.md

Update $BROWSER env var

vim ~/.profile

export BROWSER=/usr/bin/google-chrome-stable

Remove mime bindings

#!/usr/bin/env bash
# Split string into array
# SPLITTED_ARRAY is a global array to store split result
#
# Usage example:
#
# split "1,2,3", ","
# result=0
# for i in ${SPLITTED_ARRAY[*]}
@boo1ean
boo1ean / 1.js
Last active July 14, 2020 19:33
function findLadders (beginWord, endWord, wordList) {
let results = []
let paths = [[beginWord]]
while (true) {
findPossibleMutations()
if (results.length) {
return results
}
@boo1ean
boo1ean / constraints.sql
Last active May 16, 2019 08:39
Disable constraints in postgres
-- As superuser you can connect to the target database
\c best-database
-- Drop specific table triggers
alter table foo disable trigger all;
-- After you dirty work don't forget to reenable triggers
alter table foo enable trigger all;
@boo1ean
boo1ean / bluetooth-headphones-on-linux.md
Last active April 15, 2019 08:45
bluetooth-headphones-on-linux
yay -S pulseaudio-bluetooth bluez-utils
sudo vim /etc/bluetooth/main.conf 

ControllerMode = bredr
AutoEnable=true
printWarning @ warning.js:33
warning @ warning.js:57
handleElement @ ReactDOMNullInputValuePropHook.js:25
onBeforeUpdateComponent @ ReactDOMNullInputValuePropHook.js:36
callHook @ ReactDebugTool.js:25
emitEvent @ ReactDebugTool.js:37
onBeforeUpdateComponent @ ReactDebugTool.js:324
receiveComponent @ ReactReconciler.js:112
updateChildren @ ReactChildReconciler.js:107
_reconcilerUpdateChildren @ ReactMultiChild.js:204
fn sort(list: &mut [i32]) -> &mut [i32] {
list[0] = list[1];
list
}
fn main() {
println!("Hello, world!");
let mut v = vec![1, 2, 3];
let q = sort(&mut v);
q[2] = q[1];
const cars = [
{
title: 'Opel',
power: 100,
},
{
title: 'Audi',
power: 200,
},
{
@boo1ean
boo1ean / setup.sh
Last active December 21, 2016 18:54
Setup apache-2.4.4 + php-5.5.0 on CentOS 6.3
#!/usr/bin/env bash
# Install dependencies
yum update -y
yum install -y gcc apr-devel apr-util-devel openssl-devel pcre-devel libxml2-devel libcurl-devel
mkdir setup && cd setup
wget http://mirrors.besplatnyeprogrammy.ru/apache//httpd/httpd-2.4.4.tar.gz
tar -xvf httpd-2.4.4.tar.gz