This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mergeSort(arr) { | |
// Base case: if the array has 1 or 0 elements, it is already sorted | |
if (arr.length <= 1) { | |
return arr; | |
} | |
// Recursive case: divide the array into halves and sort each half | |
const mid = Math.floor(arr.length / 2); | |
const leftHalf = mergeSort(arr.slice(0, mid)); | |
const rightHalf = mergeSort(arr.slice(mid)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Works for iMac 5K late 2014 under Ubuntu 20.04 | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "Restart with root privelegies" | |
sudo su -s "$0" | |
exit | |
fi | |
T=10s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alpine Linux Docker image ready for React/JavaScript development with git, neovim + plugins, tmux and current node.js | |
Intro in Russian https://youtu.be/YrBaoMfxjvA | |
Docker file https://github.com/app/indocker-dev-node-react/blob/alpine/Dockerfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Have to be run in git project root folder | |
RU_ARRAY=($(find .|grep html$|sed s/"^.*\/"//|sort |uniq -u| sed 's/ /\n/g')) | |
for FILE in "${RU_ARRAY[@]}" | |
do | |
grep -Rn "$FILE" ./*|grep -v canonical|grep openbsd.org | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Follow the WORKAROUND: | |
1. Add a comand to /etc/rc.local, add the following line above "exit 0": | |
setpci -s 00:1c.2 0x50.B=0x41 | |
2. Add the same comand to /etc/apm/resume.d/21aspm (which does not exist yet): | |
setpci -s 00:1c.2 0x50.B=0x41 | |
3. Add the following to /etc/modprobe.d/sdhci.conf: | |
options sdhci debug_quirks2=4 | |
4. Re-generate initrd: | |
sudo update-initramfs -u -k all | |
5. Reboot or reload sdhci module: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# class | |
class Singleton | |
instance = undefined | |
title: null | |
setTitle: (title) -> | |
@title = title | |
getTitle: -> | |
@title |