- Blog
- How to GraphQL - Ruby (Tutorial)
- Speaker deck
| Date | Event | Title | Slides | Video | Code |
| Date | Event | Title | Slides | Video | Code |
| #!/usr/bin/env bash | |
| #################################################################################### | |
| # Slack Bash console script for sending messages. | |
| #################################################################################### | |
| # Installation | |
| # $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack | |
| # $ chmod +x /usr/bin/slack | |
| #################################################################################### | |
| # USAGE | |
| # Send message to slack channel/user |
| defmodule RubyServer do | |
| use GenServer | |
| def start_link(opts \\ []) do | |
| GenServer.start_link(__MODULE__, nil, opts) | |
| end | |
| def cast(server, cmd) do | |
| GenServer.cast(server, {:cast, cmd}) | |
| end |
| cmd = ~S""" | |
| ruby -e ' | |
| require "bundler" | |
| require "erlang/etf" | |
| require "stringio" | |
| @input = IO.new(3) | |
| @output = IO.new(4) | |
| @output.sync = true |
| cmd = ~S""" | |
| ruby -e ' | |
| require "bundler" | |
| require "erlang/etf" | |
| require "stringio" | |
| STDOUT.sync = true | |
| def receive_input | |
| encoded_length = STDIN.read(4) |
| cmd = ~S""" | |
| ruby -e ' | |
| STDOUT.sync = true | |
| def receive_input | |
| encoded_length = STDIN.read(4) | |
| return nil unless encoded_length | |
| length = encoded_length.unpack("N").first | |
| STDIN.read(length) |
| cmd = ~S""" | |
| ruby -e ' | |
| STDOUT.sync = true | |
| context = binding | |
| while (cmd = gets) do | |
| eval(cmd, context) | |
| end | |
| ' | |
| """ |
| #!/bin/bash | |
| /usr/bin/rsync -r -t -p -o -g -x --delete --size-only -l -s --exclude-from=/home/guda/bin/ssd_backup_exclude.txt /home/guda/ /home/guda/external/backup |