Useful crap and things I can never remember.

How to get random hex values (color values) in python:

rand_color = "#" + str(random.randint(0, 16777215))

Creating a database user and giving them full rights to a database:

 GRANT ALL PRIVILEGES ON db_name.* TO 'db_user'@'localhost' IDENTIFIED BY 'the_password!' WITH GRANT OPTION; 
Tagged as hints , mysql random
Written by Andrew Konkol on May 27th, 2011

0 Comments

Log in with Twitter, Google, Facebook, LinkedIn to leave a comment.