Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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
| 1. pip install -r reqs.pip | |
| 2. server.py | |
| 3. open client.html in browser | |
| 4. redis-cli publish push '123456' | |
| 5. check browser console |
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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
| user www-data; | |
| pid /var/run/nginx.pid; | |
| worker_processes auto; | |
| worker_rlimit_nofile 65000; | |
| events { | |
| worker_connections 2048; | |
| multi_accept on; | |
| use epoll; | |
| } |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="[Tokyo railways]" /> | |
| <meta charset=utf-8 /> | |
| <meta name="viewport" content="user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui"> | |
| <title>Tokyo railways</title> | |
| <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" /> | |
| <link href="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.min.css" rel="stylesheet" /> | |
| <link href="style.css" rel="stylesheet"> |
A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.
How to use:
- The link in the table of content jumps at the copy of the answer on this page.
- The link on the answer itself points back at the original post.
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
| image: docker:latest | |
| before_script: | |
| - apt-get update -y # Updating the Ubuntu Docker instance. | |
| - python -V # Print out python version for debugging. | |
| - apt install -y zip jq | |
| - pip install awscli --upgrade --user | |
| - export PATH=~/.local/bin:$PATH # Required for awscli. | |
| - aws --version # Print out aws cli version for debugging. |
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
| image: docker:latest | |
| variables: | |
| REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME> | |
| REGION: eu-central-1 | |
| TASK_DEFINTION_NAME: <TASK DEFINITION NAME> | |
| CLUSTER_NAME: <CLUSTER NAME> | |
| SERVICE_NAME: <SERVICE NAME> | |
| services: |
To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT
- Get PAT (personal access token)
Personal Settings > Developer settings > Personal access tokens
OlderNewer