(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| sudo apt-get update | |
| sudo apt-get -y upgrade | |
| cd /tmp | |
| wget https://dl.google.com/go/go1.12.linux-amd64.tar.gz | |
| sudo tar -xvf go1.12.linux-amd64.tar.gz | |
| sudo mv go /usr/local | |
| export GOROOT=/usr/local/go | |
| export GOPATH=$HOME/go |
| import akka.actor.{ Actor, ActorRef, Props, ActorSystem } | |
| case class ProcessStringMsg(string: String) | |
| case class StringProcessedMsg(words: Integer) | |
| class StringCounterActor extends Actor { | |
| def receive = { | |
| case ProcessStringMsg(string) => { | |
| val wordsInLine = string.split(" ").length | |
| sender ! StringProcessedMsg(wordsInLine) |
| https://github.com/kubernetes/client-go/tree/master/examples/in-cluster-client-configuration |
| # Copyright 2017, Google, Inc. | |
| # Licensed under the Apache License, Version 2.0 (the "License") | |
| FROM node:6-onbuild | |
| EXPOSE 3000 | |
| ENV LANGUAGE English | |
| ENV API_KEY 123-456-789 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env bash | |
| if [[ $(pmset -g ps | head -1) =~ "Battery Power" ]]; then | |
| osascript -e 'display notification "You are starting Slack while running on battery power" with title "Battery Drain Source Detected" subtitle ""' | |
| fi | |
| open /Applications/Slack.app |
| # List Cron Jobs | |
| $ for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done | |
| $ for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done | |
| # Edit crontab | |
| $ sudo crontab -e -u www-data |
| package main | |
| import ( | |
| "crypto/sha256" | |
| "fmt" | |
| "io" | |
| "log" | |
| "os" | |
| ) |
| package main | |
| import ( | |
| "go.uber.org/zap" | |
| "encoding/json" | |
| ) | |
| func main() { | |
| cfg := zap.NewProductionConfig() |
| #!/bin/bash | |
| # | |
| # Installation of Hashicorp Nomad for deploy process | |
| # | |
| # Download this file: | |
| # curl -sSL https://gist.githubusercontent.com/ryanpadilha/351a4a4f17afdc8eb0d963897b98122a/raw/ -o nomad-install.sh | |
| # | |
| echo "Initializing script for devops - Nomad Hashicorp" |