Skip to content

Instantly share code, notes, and snippets.


KRogLA krogla

View GitHub Profile
krogla / MiddlewareES6.js
Created Apr 29, 2020 — forked from sylvainleris/MiddlewareES6.js
A very minimal Javascript (ES5 & ES6) Middleware Pattern Implementation
View MiddlewareES6.js
class Middleware {
constructor() {
// Array prototype last
if (!Array.prototype.last) {
Array.prototype.last = function() {
return this[this.length - 1];
krogla / index.ts
Created Apr 29, 2020 — forked from Curtis017/index.ts
Simple middleware implementation using typescript and ES6
View index.ts
import pipeline, { Middleware } from './pipeline';
const step1: Middleware<any, any> = (req, res, next) => {
if (req.body) {
console.log(`STEP 1: \n req: ${JSON.stringify(req)}\n res: ${JSON.stringify(res)}`);
const step2: Middleware<any, any> = async (req, res, next) => {
krogla / client.js
Created Oct 4, 2019 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for clients to join
View client.js
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
krogla / remove.js
Last active Mar 7, 2018
remove unused contracts from Mist
View remove.js
//rename unused contracts to '--' and run script
function(m) { if ( == '--') {CustomContracts.remove(m._id);}}
View mist_cleanup.js
//Remove contracts by ID
//Remove tokens by ID
//Remove all contracts
krogla / QueueRetryAllCommand.php
Created Nov 14, 2017 — forked from JacobBennett/QueueRetryAllCommand.php
Laravel Queue:Retry-Multiple and Queue:Retry-All
View QueueRetryAllCommand.php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class RetryAllCommand extends Command
* The name and signature of the console command.
You can’t perform that action at this time.