Handling different events with pattern matching.
def handle_info(%{
event: "presence_diff",
topic: "user-activity"
}, socket) do
send_update(
UserActivityLive,
id: socket.assigns.user_activity_component_id)
| from jinja2 import Template | |
| text = """ | |
| hi {{ name|default(other_name) }} | |
| """ | |
| template = Template(text) | |
| template.render(name="foo") # passing variables here to the text template if needed | |
| template.render(other_name="bar") |
| # Ease of use settings | |
| set -g mouse on | |
| # List of plugins | |
| set -g @plugin 'tmux-plugins/tpm' | |
| set -g @plugin 'tmux-plugins/tmux-sensible' | |
| # Theme | |
| set -g @plugin 'dracula/tmux' | |
| set -g @dracula-show-powerline true |
Handling different events with pattern matching.
def handle_info(%{
event: "presence_diff",
topic: "user-activity"
}, socket) do
send_update(
UserActivityLive,
id: socket.assigns.user_activity_component_id)
| NameVirtualHost answers.example.com:80 | |
| <VirtualHost answers.example.com:80> | |
| ServerAdmin webmaster@localhost | |
| DocumentRoot /var/www/answers | |
| <Directory /> | |
| Options FollowSymLinks | |
| AllowOverride None | |
| </Directory> | |
| <Directory /var/www/answers/> |
| #!/usr/bin/env zsh | |
| function aws-rds-describe() { | |
| zparseopts -D -E -A opts -- o: | |
| output=${opts[-o]:-"table"} | |
| name=${1} | |
| query=( | |
| "DBInstances[]" | |
| ".{" |
| function sum(n){ | |
| arguments.callee.toString = function(){ | |
| return sum; | |
| } | |
| if(!arguments.callee.sum){ | |
| arguments.callee.sum=0 | |
| } | |
| arguments.callee.sum += n | |
| var sum = arguments.callee.sum | |
| return arguments.callee |
| ### Keybase proof | |
| I hereby claim: | |
| * I am jamescarr on github. | |
| * I am jamescarr (https://keybase.io/jamescarr) on keybase. | |
| * I have a public key ASAiU20sGsNecdzYGqyyswSbo3qJw380XF_-HrTCY1cNUAo | |
| To claim this, I am signing this object: |
| for { | |
| select { | |
| case m, ok := <-c: | |
| if !ok { | |
| breakl | |
| } | |
| handle(m) | |
| case <-time.After(1 * time.Minute): | |
| fmt.Println("timed out") | |
| break |