Skip to content

Instantly share code, notes, and snippets.

View DevMaurice's full-sized avatar
🎯
Focusing on PHP,Laravel

Maurice Kuria DevMaurice

🎯
Focusing on PHP,Laravel
View GitHub Profile
@DevMaurice
DevMaurice / socket-cheatsheet.js
Created December 16, 2017 06:46 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@DevMaurice
DevMaurice / stream_file.php
Created November 11, 2017 05:21 — forked from fideloper/stream_file.php
Stream file from S3 to browser, assume Laravel Filesystem usage
<?php
/*************************************************************************
* Get File Information
*/
// Assuming these come from some data source in your app
$s3FileKey = 's3/key/path/to/file.ext';
$fileName = 'file.ext';