- Client (Customer)
- Load Balancer (Greeter)
- Data Center (Coffee Shop)
- Distributed Message Queue (Bulletin Board w/ Sticky Notes)
- Producer (Cashier)
- Consumer (Barista)
- Database (Ledger Book)
This file contains 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
package akka.http.scaladsl | |
import java.io.File | |
import akka.http.scaladsl.unmarshalling.Unmarshal | |
import akka.util.ByteString | |
import scala.concurrent.duration._ | |
import akka.actor.ActorSystem |
This file contains 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
var url = // Webhook URL | |
var text = // Text to post | |
$.ajax({ | |
data: 'payload=' + JSON.stringify({ | |
"text": text | |
}), | |
dataType: 'json', | |
processData: false, | |
type: 'POST', | |
url: url |
This file contains 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
var request = require ("request"); | |
var urlWebHook = "https://hooks.slack.com/services/abcdef"; //the URL you get on your "incoming web hooks" page. | |
function sendToSlack (s, theUsername, theIconUrl, theIconEmoji, theChannel) { | |
var payload = { | |
text: s | |
}; | |
if (theUsername !== undefined) { | |
payload.username = theUsername; |
This file contains 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
// Spark 2.1 | |
val spark = SparkSession.builder().master("local").getOrCreate() | |
// Given a list of mixture of strings in integers | |
val values = List("20030100013280", 1.0) | |
// Create `Row` from `Seq` | |
val row = Row.fromSeq(values) | |
// Create `RDD` from `Row` |
This file contains 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
# smtplib module send mail | |
import smtplib | |
TO = 'recipient@mailservice.com' | |
SUBJECT = 'TEST MAIL' | |
TEXT = 'Here is a message from python.' | |
# Gmail Sign In | |
gmail_sender = 'sender@gmail.com' |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
In regular python array, a slice view of an array is actually a copy. Modifiying elements through the slice won't affect the original array.
>>> arr = [0, 1, 2]
>>> arr[0:][0] = 100
>>> arr
[0, 1, 2]
This file contains 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
// | |
// Created by Johnny on 3/9/2018. | |
// Copyright (c) 2018 Johnny@Co-fire.com. All rights reserved. | |
// | |
import UIKit | |
import RxCocoa | |
import RxSwift | |
private var prepareForReuseBag: Int8 = 0 |
This file contains 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
''' people export''' | |
import base64 | |
import csv | |
import sys | |
import time | |
import urllib # for url encoding | |
import urllib2 # for sending requests | |
try: |