This file contains 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
Open a terminal and run the following commands (cd to your home directory first) | |
sudo apt install xbacklight | |
xauth generate :0 . trusted | |
xauth add ${HOST}:0 . $(xxd -l 16 -p /dev/urandom) | |
sudo vi /etc/udev/rules.d/98-backlight.rules | |
Paste the following into the 98-backlight.rules | |
################################################# START ################################### | |
# Adjust screen brightness according to power state | |
# 1st rule for when on AC | |
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", RUN+="/usr/bin/xbacklight -set 85" |
This file contains 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 Node { | |
constructor(data) { | |
this.data = data; | |
this.count = 1; | |
this.left = null; | |
this.right = null; | |
this.inorderOut = []; | |
this.preorderOut = []; | |
this.postorderOut = []; | |
} |
This file contains 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 Node { | |
constructor(data) { | |
this.data = data; | |
this.left = null; | |
this.right = null; | |
this.inorderOut = []; | |
this.preorderOut = []; | |
this.postorderOut = []; | |
} | |
insert(data) { |
This file contains 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
// JavaScript (ES6) port of the code at https://gist.github.com/bhelx/778542 | |
// Also handles leading 0's in strings | |
const BASE = 62; | |
const UPPERCASE_OFFSET = 55; | |
const LOWERCASE_OFFSET = 61; | |
const DIGIT_OFFSET = 48; | |
class Base62{ | |
constructor() { |
NewerOlder