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
@mohamedhayibor
mohamedhayibor / medium-unclap.js
Created January 3, 2019 07:59
Unclap everything on Medium
/**
* Unclaps everything on Medium
* @author Jane Manchun Wong
*/
(async () => {
if ( window.location.host !== 'medium.com' ) {
console.error(`This script won't work unless you go to Medium:\nhttps://medium.com/me`)
return
}
/**
@mohamedhayibor
mohamedhayibor / Signature-composition.md
Created September 4, 2018 14:37
Is signature composition possible?

I've been thinking about user reputation and privileges for a while. And on Air Asia's plane today, I thought what if you could use some kind of Signature Composition scheme?

I got to this idea with the following question:

Could someone implement incremental signing for more privileges?

Where with more signing would mean more legit reputation, and power to affect/mutate an ecosystem.

For instance, if user's public address is used as signing and auth, you would make them sign along their entire journey.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CryptoZombies front-end</title>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="web3.min.js"></script>
<script language="javascript" type="text/javascript" src="cryptozombies_abi.js"></script>
</head>
<body>
@mohamedhayibor
mohamedhayibor / richhickey.md
Created October 29, 2017 11:42 — forked from prakhar1989/richhickey.md
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@mohamedhayibor
mohamedhayibor / core.cljs
Created October 26, 2017 11:26 — forked from bhauman/core.cljs
Helpful patterns when developing with ClojureScript Figwheel and Express js
(ns todo-server.core
(:require
[cljs.nodejs :as nodejs]
[figwheel.client :as fw]))
(nodejs/enable-util-print!)
(defonce express (nodejs/require "express"))
(defonce serve-static (nodejs/require "serve-static"))
(defonce http (nodejs/require "http"))
@mohamedhayibor
mohamedhayibor / 00_destructuring.md
Created September 20, 2017 11:17 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

@mohamedhayibor
mohamedhayibor / debug-core.cljs
Created August 29, 2017 11:57
Debugging stackoverflow question
(ns cipherize.core
(:require [reagent.core :as reagent :refer [atom]] ))
(def alphabet-chars
(mapv char (range 97 (+ 97 26))))
(def alphabet
(mapv str alphabet-chars))
(defn shift-by-one
@mohamedhayibor
mohamedhayibor / open-all.js
Last active August 30, 2017 23:19
Automates the search of a security on Google finance, Yahoo Finance, Bloomberg and Morningstar.
#!/usr/bin/env node
/**
* This program automates the opening of a security's
* general description and data from:
* - Google Finance
* - Yahoo Finance
* - Bloomberg
* - Morningstar
*/
@mohamedhayibor
mohamedhayibor / tmux.sh
Created July 19, 2017 06:20 — forked from reborg/tmux.sh
Handy tmux.sh to add to your new Clojure project that creates a single window with one main Vim pane and a secondary small at the bottom which runs Midje autotest on top of a lein repl session.
export PROJECT_NAME=$1
export WORKING_DIR=/me/prj/$PROJECT_NAME
cd $WORKING_DIR;
# create the session
tmux start-server
tmux new-session -d -s $PROJECT_NAME -n work
# start vim in working dir
tmux select-window -t$PROJECT_NAME:1

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats. The link points back at them.

If you are talking about the aspect of pattern matching that acts as a conditional based upon structure, I'm not a big fan. I feel about them the way I do about switch statements - they're brittle and