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
@gate3
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 = 'git@github.com:org/path.git'
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
gate3 / spam.md
Created Jul 16, 2018 — forked from holiman/spam.md
Description of how Ethereum can be used to fight spam
View spam.md

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
gate3 / Makefile
Created Jul 16, 2018 — forked from PhirePhly/Makefile
A crazy simple SMTP server, for educational purposes only.
View Makefile
default:
cc ccsmtp.c -o ccsmtpd -lpthread
@gate3
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.prototype.toString.call(object) !== '[object Object]' ? object:{}
for(var i in object) {
@gate3
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 https://explorer.blockstack.org/address/18SUNQvTaC91szu4kUGsZc11pdEu6X6YUJ
View auth.php
<?php
/**
* Get current Laravel active session from outside laravel instance.
* Tested Laravel 5.2
*
*
*/
function getLaravelUser()
{
require __DIR__ . '\path\to\bootstrap\autoload.php';
@gate3
gate3 / App.css
Last active Apr 26, 2019
COOKPAD WEB INTERVIEW TEST
View App.css
@import '~antd/dist/antd.css';
html, body {
height: 100%;
font-size: inherit;
}
div.ant-layout-content{
background: #fff;
}
div.large-bg{
@gate3
gate3 / nigeria.json
Last active Oct 11, 2016
A list of nigerian states and local government hosted on azure cdn in a json file
View nigeria.json
https://octopuserver.blob.core.windows.net/public/nigeria.json
@gate3
gate3 / gist:21f70cff33613c99dad0ce481890bba6
Last active Sep 14, 2016
Create a parse user from logged in user
View gist:21f70cff33613c99dad0ce481890bba6
Hi,
I recently wanted to create a new user from a logged in user account. That was the easy part, i used cloud code to create the user.
The problem started when i attempted creating another user immediately after or at anytime after creating the current user. I kept
getting an invalid token exception.
After a lot of pondering and fruitless googling. I came to the realization that parse logs in a new user automatically, hence the
error, because the local user and the cloud code user would be different.
So the solution is that, as soon as you create a new user just logout the current user immediately in the success function of your
cloud code. For example:
You can’t perform that action at this time.