Skip to content

Instantly share code, notes, and snippets.

@muz3
muz3 / bind.js
Created April 20, 2022 01:07 — forked from yyx990803/bind.js
implementing Function.prototype.bind
Function.prototype.bind = function (context) {
if (typeof this !== 'function') {
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var fn = this, // the function to bind
slice = Array.prototype.slice // cache slice method
args = slice.call(arguments, 1), // get the array of addtional arguments (to be curried)
noop = function () {}, // the intermediate function to serve as a prototype chain connector
// (assuming we don't have Object.create() here)
bound = function () {
@muz3
muz3 / four_elements_simple_design.md
Created February 27, 2021 06:46 — forked from O-I/four_elements_simple_design.md
The Four Elements of Simple Design

The Four Elements of Simple Design

  • Introduced by [Kent Beck][beck] in the 1990s.
  • Part of his software development methodology [Extreme Programming][extreme-programming].
  • His exact wording appears in the [White Book][white-book].

The rules can be stated as followed:

  1. Passes all tests
  2. Maximizes clarity
@muz3
muz3 / vanilla-js-cheatsheet.md
Created December 8, 2020 22:57 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@muz3
muz3 / service.js
Created November 30, 2020 06:23 — forked from paulsturgess/service.js
An example Service class wrapper for Axios
import axios from 'axios';
class Service {
constructor() {
let service = axios.create({
headers: {csrf: 'token'}
});
service.interceptors.response.use(this.handleSuccess, this.handleError);
this.service = service;
}
@muz3
muz3 / initializers:hello.js
Created November 12, 2020 19:44 — forked from rossta/initializers:hello.js
Webpack with require.context
console.log('initializer hello.js');
@muz3
muz3 / 1_kubernetes_on_macOS.md
Created October 31, 2020 21:15 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@muz3
muz3 / 05-svc.sh
Created October 29, 2020 00:41 — forked from vfarcic/05-svc.sh
cd k8s-specs
git pull
minikube start --vm-driver=virtualbox
kubectl config current-context
cat svc/go-demo-2-rs.yml
@muz3
muz3 / 1.md
Created September 12, 2020 05:17 — forked from swyxio/1.md
Learn In Public - 7 opinions for your tech career

2019 update: this essay has been updated on my personal site, together with a followup on how to get started

2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos

@muz3
muz3 / master-javascript-interview.md
Created September 11, 2020 23:21 — forked from Geoff-Ford/master-javascript-interview.md
Eric Elliott's Master the JavaScript Interview Series
@muz3
muz3 / composing-software.md
Created September 11, 2020 17:20 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series