Skip to content

Instantly share code, notes, and snippets.

View mohamedhayibor's full-sized avatar
💭
Crawled out from Burnout, Back to Badass 💪🏾

Void mohamedhayibor

💭
Crawled out from Burnout, Back to Badass 💪🏾
View GitHub Profile

Mindfulness on the environment

I have been buying stuff with a lot of trash around me. I am going to drastically change this.

I have to care for the environment at a personal level.

I have to be more mindful of the things I buy.

I have to think twice before I carry a plastic bag.

Keybase proof

I hereby claim:

  • I am mohamedhayibor on github.
  • I am mohamedhayibor (https://keybase.io/mohamedhayibor) on keybase.
  • I have a public key ASB072hk6agRTloePNFKQrsqSW9fVqpY1EX6zHEe3VED3Ao

To claim this, I am signing this object:

@mohamedhayibor
mohamedhayibor / ethNews.js
Created June 7, 2017 12:41
Automatically open links to keep up with Ethereum news.
#!/usr/bin/env node
const open = require('open');
const links = ["https://www.reddit.com/r/ethereum/", "https://github.com/ethereum/EIPs",
"https://gitter.im/ethereum/EIPs", "https://medium.com/tag/ethereum",
"https://medium.com/tag/cryptocurrency", "https://medium.com/tag/smart-contracts",
"https://medium.com/tag/blockchain"];
links.forEach( link => {
@mohamedhayibor
mohamedhayibor / index.js
Created March 14, 2017 03:00
Demo: receiving payloads from Github
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.route("/ping/github/:user/:repo").post( (req, res) => {
console.log("req: ", req.body);

Keybase proof

I hereby claim:

  • I am mohamedhayibor on github.
  • I am mohamedhayibor (https://keybase.io/mohamedhayibor) on keybase.
  • I have a public key ASDxH7Ai35xJpoP6SUGklqkCY69BZUnZAgCeOxzl3O6xvAo

To claim this, I am signing this object:

@mohamedhayibor
mohamedhayibor / Rust_Compilation_Tweaks.md
Last active August 5, 2016 22:03
List of Rust compilation tweaks

Allowing dead code

#[allow(dead_code)]

Allowing unused variables

#[warn(unused_assignments)]
@mohamedhayibor
mohamedhayibor / mergeSort.js
Created May 7, 2016 01:12 — forked from dsernst/mergeSort.js
Merge Sort in JavaScript
var mergeSort = function(array) {
if (array.length === 1) {
return array
} else {
var split = Math.floor(array.length/2)
var left = array.slice(0, split)
var right = array.slice(split)
left = mergeSort(left)
right = mergeSort(right)
@mohamedhayibor
mohamedhayibor / build_trie.js
Created April 13, 2016 06:37 — forked from msbarry/build_trie.js
Building/searching a trie in js
var txt = require("fs").readFileSync("app/names.txt", "utf8");
var nicknames = require('./nicknames');
var words = txt.split("\n");
var trie = build(words);
optimize(trie);
require('fs').writeFileSync('app/trie.js', 'trie = ' + toString(trie));
function tokenize(str) {
return str
.toLowerCase()
@mohamedhayibor
mohamedhayibor / dfs-bfs-non-recursive.js
Created March 12, 2016 03:22 — forked from DmitrySoshnikov/dfs-bfs-non-recursive.js
Non-recursive DFS and BFS algorithms
/**
* Depth-first and Breadth-first graph traversals.
*
* In this diff we implement non-recursive algorithms for DFS,
* and BFS maintaining an explicit stack and a queue.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style license
*/
"use strict";
// simple fisher yates implementation
const shuffle = (deck) => {
let randomizedDeck = [];
let array = deck;
while ( array.length !== 0) {
let rIndex = Math.floor(array.length * Math.random());
randomizedDeck.push(array[rIndex]);
array.splice(rIndex, 1)
}