Skip to content

Instantly share code, notes, and snippets.

Doyin Olarewaju gate3

Block or report user

Report or block gate3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View main.js
// Note i skipped a lot of steps here like starting a server etc
const redis = require('redis')
const sub = redis.createClient();
const cp = require('child_process');
const glob = require('glob');
glob('!(node_modules)/**/*.worker.js', function (er, files) { // Ignore all workers in node_modules and use only those defined within my app
for (let f of files) {
View user.worker.js
const BaseQueue = require('./base_worker')
const userModel = require('../models/userModel')
class UserWorker extends BaseQueue {
constructor () {
super('users', userModel)
runQueue () {
View base.worker.js
const redis = require('redis')
const QueueHelper = require('../../util/rabbitmq.helper');
const modelContainer = require('../models')
const pub = redis.createClient(); // creating for localhost
class BaseWorker {
constructor (type, model) {
this.type = type
this.QueueName = `${type}:queue`
gate3 / rabbitMqHelper.js
Last active Sep 13, 2019
Sending Realtime Events To The Client From Node child process
View rabbitMqHelper.js
const rabbitMq = require('amqplib');
class RabbitMqHelper {
constructor (channel_name) { = null;
this.connection = null;
this.queueAssert = null;
this.channel_name = channel_name
gate3 / nodegit-private-clone-test.js
Created Jul 15, 2019 — forked from mojavelinux/nodegit-private-clone-test.js
Clone a private repository using nodegit
View nodegit-private-clone-test.js
const git = require('nodegit')
const fs = require('fs-extra')
const { URL } = require('url')
const REPO_URL = ''
const CLONE_DIR = '/tmp/private-repo-clone-test'
;(async () => {
await fs.emptyDir(CLONE_DIR)
let authAttempted = false
await git.Clone.clone(REPO_URL, CLONE_DIR, {
gate3 /
Created Jul 16, 2018 — forked from holiman/
Description of how Ethereum can be used to fight spam

Stopping spam

This blog post by Jonathan Brown suggested replacing SMTP with Ethereum blockchain; specifically, utilizing the log channel to monitor events.

With this approach, emails wouldn't actually be stored within the EVM (Ethereum Virtual Machine) storage, but every email would still be present in the blockchain blocks. The EVM log mechanism would make it simple for a full node to monitor and be alerted whenever an email was submitted.

I don't believe that this would be feasible in the real world, for several reasons

  • There are lots of email being sent, some of them quite large
  • Most people wouldn't want their emails forever on the blockchain, the future resiliency of GPG is unknown, and GPG encryption does not provide perfect forward secrecy. Once a key is compromised, all is revealed.
gate3 / Makefile
Created Jul 16, 2018 — forked from PhirePhly/Makefile
A crazy simple SMTP server, for educational purposes only.
View Makefile
cc ccsmtp.c -o ccsmtpd -lpthread
gate3 / deepClone.js
Created Jul 5, 2018
Deepclone javascript function
View deepClone.js
function deepClone(object) {
//first check if it is any of the types seen as object in javascript
if(typeof object !== 'object'){
throw new Error('please provide an object')
We need to compare using Object.prototype because typeof only comparse by type and type for dates and arrays are always object. While Object.prototype compares the constructor
var clone = !== '[object Object]' ? object:{}
for(var i in object) {
gate3 / git_push.desktop
Created Apr 29, 2018
Git push that requests user input for commit message
View git_push.desktop
git add . && read -p "Input a message: " message && git commit -m "${message}" && git push
View gist:b1a19e0485abf372ac4fcf36de20c750
Verifying my Blockstack ID is secured with the address 18SUNQvTaC91szu4kUGsZc11pdEu6X6YUJ
You can’t perform that action at this time.