Skip to content

Instantly share code, notes, and snippets.

View zetekla's full-sized avatar

PrTran zetekla

View GitHub Profile
@zetekla
zetekla / gist:810eeef9f3c7f7e656af4fd921c5cb88
Last active July 5, 2017 08:14
Kubuntu Bluetooth troubleshooting
sudo /etc/init.d/bluetooth restart
hcitool dev
bluetoothctl
sudo service bluetooth restart
lspci -knn | grep Net -A2
dmesg | grep bluetooth
@zetekla
zetekla / flatten.js
Last active February 27, 2018 05:50
flatten arrays
var arr = [[1,2,[3]],4];
function flatten(arr){
return arr.reduce(function(pre,curr){
return pre.concat(curr.constructor === Array ? flatten(curr) : curr);
}, []);
}
console.log(flatten(arr));
function solutionAvgColor (hex1, hex2) {