Skip to content

Instantly share code, notes, and snippets.

@Diego81
Diego81 / enable php
Created May 4, 2018
enable errors in php
View enable php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@Diego81
Diego81 / retry.php
Created May 4, 2018
Guzzle Http client retry
View retry.php
require './vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
@Diego81
Diego81 / WordCounter.scala
Last active Nov 4, 2019
Simple Word Counter implemented using Akka
View WordCounter.scala
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)
You can’t perform that action at this time.