docker ps
Give me a list of all containers and their status.
docker inspect CONTAINER
Give me information about a container (you can find ip address and other info).
def score(str) | |
dictionary = { "A" => 1, "E" => 1, "I" => 1, "O" => 1, "U" => 1, "L" => 1, | |
"N" => 1, "R" => 1, "S" => 1, "T" => 1, "D" => 2, "G" => 2, | |
"B" => 3, "C" => 3, "M" => 3, "P" => 3, "F" => 4, "H" => 4, | |
"V" => 4, "W" => 4, "Y" => 4, "K" => 5, "J" => 8, "X" => 8, | |
"Q" => 10, "Z" => 10 } | |
split_string = str.upcase.split("") | |
sum = [] | |
split_string.each do |i| | |
sum << dictionary[i] |
Great talk on how webhooks work on a general level: https://vimeo.com/album/4045988/video/172433862
Set-up a webhook consumer like you would set-up any route in your app: http://cookieshq.co.uk/posts/how-to-receive-webhooks-in-your-ruby-on-rails-application/
Sometimes when you try to run your file, you may get an error because the file is not in your Ruby path. You can:
Run irb -I.
to fix this but this is a pain. You could alias irb
to irb -I.
...
You could also use bundle console
to open irb with your gem code loaded (assuming that you _are_using bundler).
You could also...
task :console do
require 'irb'
version: '2' #The Docker Compose file format version to be used | |
services: | |
database: #The name of the container, you can name this whatever you want. | |
image: mysql:latest #The image you are pulling into the container | |
environment: | |
MYSQL_ROOT_PASSWORD: tacos | |
MYSQL_DATABASE: tacos | |
MYSQL_USER: tacos | |
MYSQL_PASSWORD: tacos |
How to copy a file in a remote onto your local machine:
scp REMOTE:FILENAME ./
REMOTE: where the file is FILENAME: the file you want to copy ./ where the file will be copied to (do not have to name it as it will use the name of the file in the remote
You can run a SQL query and pipe into a file on a remote location, then use method above to copy locally.
package main | |
import "fmt" | |
func main() { | |
for i := 0; i <= 500; i++ { | |
//Print the integer, the string of i (rune), and the bytes of i | |
fmt.Println(i, " - ", string(i), []byte(string(i))) | |
} |
#install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
#install apps | |
brew install --cask google-chrome | |
brew install --cask spotify | |