const randomHexCol = () => '#' + (0x1000000 + Math.random() * 0xffffff).toString(16).slice(1, 6);
randomHexCol()
randomHexCol() // #abea67
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
#!/usr/bin/env bash | |
# run as root | |
# | |
# GIST_URL="<e.g. https://gist.githubusercontent.com/marcg1968/...>" | |
# wget -O - "$GIST_URL" | bash | |
# | |
# force script to run as root | |
[ $(id -u) == "0" ] || { sudo "$0" "$@"; exit $?; } |
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
#!/usr/bin/env bash | |
# run as root | |
# | |
# GIST_URL="<e.g. https://gist.githubusercontent.com/marcg1968/...>" | |
# wget -O - "$GIST_URL" | bash | |
# | |
#!/usr/bin/env bash |
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
#!/usr/bin/env bash | |
# run as root | |
# | |
# GIST_URL="https://gist.githubusercontent.com/marcg1968/e1357e71eca8074bcfe6d450624b18ee/raw/3de0c0701a3e504d588763dea998667f1d582b47/gistfile1.txt" | |
# wget -O - "$GIST_URL" | bash | |
[ $(id -u) == "0" ] || { sudo "$0" "$@"; exit $?; } | |
USR="marc" |
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
cd /tmp | |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ | |
sudo apt update && \ | |
sudo dpkg -i "/tmp/"google-chrome-stable_current_amd64.deb && \ | |
sudo apt-get install -f | |
cd - |
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
URL="https://www.dropbox.com/s/sgwpa3mez110965/common_setup_desktop.sh?dl=1" | |
sudo su -c "bash <(wget -qO- "$URL")" root |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# http://stackoverflow.com/a/1181922 | |
def base36encode(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): | |
"""Converts an integer to a base36 string.""" | |
if not isinstance(number, (int, long)): | |
raise TypeError('number must be an integer') |