In Ruby, a Symbol is the most efficient way, in terms of time and memory, to represent a set of characters.
Most commonly, a Symbol is a single word prefixed by a colon:
:hello| 1. Open "my.ini" in "C:\xampp\mysql\bin\" directory. | |
| 2. Edit the following lines. | |
| # Add the following code before [client]. | |
| default-character-set=utf8 | |
| # Add the following code before [mysqld]. | |
| character-set-server=utf8 | |
| skip-character-set-client-handshake |
Hierarchical data metrics that allows fast read operations on tree like structures.
Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| Backup: | |
| docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
| Restore: | |
| cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |
| import signal | |
| import functools | |
| async def looping_task(loop, task_num): | |
| try: | |
| while True: | |
| print('{0}:in looping_task'.format(task_num)) | |
| await asyncio.sleep(5.0, loop=loop) | |
| except asyncio.CancelledError: | |
| return "{0}: I was cancelled!".format(task_num) |
| -- Create a group | |
| CREATE ROLE readaccess; | |
| -- Grant access to existing tables | |
| GRANT USAGE ON SCHEMA public TO readaccess; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
| -- Grant access to future tables | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
| ############################################################################ | |
| # # | |
| # ------- Useful Docker Aliases -------- # | |
| # # | |
| # # Installation : # | |
| # copy/paste these lines into your .bashrc or .zshrc file or just # | |
| # type the following in your current shell to try it out: # | |
| # wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash | |
| # # | |
| # # Usage: # |