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 / download.js
Created December 25, 2015 00:50 — forked from mohsen1/download.js
Download Chromecast backgrounds
var https = require('https');
var fs = require('fs');
var url = 'https://raw.githubusercontent.com/dconnolly/chromecast-backgrounds/master/backgrounds.json';
Array.prototype.getLast = function() {
return this[this.length - 1];
};
function logFail(err){
console.log('Failed!');
@mohamedhayibor
mohamedhayibor / springer-free-maths-books.md
Created December 29, 2015 04:11 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@mohamedhayibor
mohamedhayibor / memoize.js
Created December 29, 2015 16:21 — forked from addyosmani/memoize.js
memoize.js - a faster JavaScript memoizer
/*
* memoize.js
* by @philogb and @addyosmani
* further optimizations by @mathias
* Released under an MIT license.
*/
function memoize( fn ) {
return function () {
var args = Array.prototype.slice.call(arguments),
hash = "",
@mohamedhayibor
mohamedhayibor / LICENSE
Created December 31, 2015 21:07 — forked from shinout/LICENSE
Topological sort in JavaScript
Copyright 2012 Shin Suzuki<shinout310@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@mohamedhayibor
mohamedhayibor / introrx.md
Created January 30, 2016 22:17 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@mohamedhayibor
mohamedhayibor / index.html
Created February 13, 2016 00:35 — forked from d3noob/index.html
Leaflet.FileLoader Plugin for Leaflet Maps
<!DOCTYPE html>
<html>
<head>
<title>Leaflet.FileLayer Plugin</title>
<meta charset="utf-8" />
<link
rel="stylesheet"
href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css"
/>
<link
@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
*/
@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 / 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)

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