Skip to content

Instantly share code, notes, and snippets.

View animatedlew's full-sized avatar

Lewie [m80] animatedlew

View GitHub Profile
@animatedlew
animatedlew / unflatten.js
Last active December 27, 2015 15:29 — forked from panda01/Unflatten
function unflatten(list, count) {
return _.map(_.range(Math.ceil(list.length/count)), function(mul) {
return list.slice(mul*count, mul*count+count);
});
}
console.log(unflatten(_.range(1, 14), 3));
// [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13]]
@animatedlew
animatedlew / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active December 14, 2016 04:07 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@animatedlew
animatedlew / spinner.sh
Last active March 24, 2019 22:30 — forked from rpetrich/spinner.sh
Moon loading spinner
#!/bin/bash
while :; do
for c in 🌕 🌖 🌗 🌘 🌑 🌑 🌑 🌒 🌓 🌔 🌕;do
echo -en "\r" "$c"
sleep 0.1
done
done