I was so confused to understand behaviior of Golang channels, buffer, blocking, deadlocking and groutines.
I read Go by Example topics.
// Package gochannels example of how to close a channel written by several goroutines | |
package gochannels | |
import ( | |
"math/big" | |
"sync" | |
) | |
// Publisher write sequences of big.Int into a channel | |
type Publisher struct { |
/** | |
copy & paste into the browser console | |
on https://boards.greenhouse.io/andela | |
*/ | |
(() => { | |
// create display box | |
if (!$('#count-popover').length) { | |
$('#footer').append(`<div style="position:fixed;height:200px;width:200px;left:calc(50% - 100px);top: calc(50% - 100px);border:2px solid black;background-color: white;font-size: 50px;text-align: center;line-height: 200px;" id="count-popover">0</div>`) | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>GuestBook</title> | |
</head> | |
<style type="text/css"> | |
.headings{ | |
font-size: 1.3em; | |
} | |
h3{ |
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice | |
stun: | |
stun.l.google.com:19302, | |
stun1.l.google.com:19302, | |
stun2.l.google.com:19302, | |
stun3.l.google.com:19302, | |
stun4.l.google.com:19302, | |
stun.ekiga.net, | |
stun.ideasip.com, |
23.21.150.121:3478 | |
iphone-stun.strato-iphone.de:3478 | |
numb.viagenie.ca:3478 | |
s1.taraba.net:3478 | |
s2.taraba.net:3478 | |
stun.12connect.com:3478 | |
stun.12voip.com:3478 | |
stun.1und1.de:3478 | |
stun.2talk.co.nz:3478 | |
stun.2talk.com:3478 |
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if | |
a form sits there for a while (like a login form, but any the same) the csrf token in the form will | |
expire & throw a strange error. | |
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner. | |
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T! | |
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function. | |
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the |
(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.