Skip to content

Instantly share code, notes, and snippets.

View nadrane's full-sized avatar
😀
Excited

Nicholas Drane nadrane

😀
Excited
View GitHub Profile
@nadrane
nadrane / .gitignore
Last active May 12, 2020 16:42
Core Services JavaScript Interview
node_modules/
@nadrane
nadrane / regex.js
Created December 11, 2017 21:36
A very simple regular expression engine
//A walkthrough of this solution exists here: https://nickdrane.com/build-your-own-regex/
function matchOne(pattern, text) {
if (!pattern) return true;
if (!text) return false;
return pattern === "." || text === pattern;
}
function search(pattern, text) {
if (pattern[0] === "^") {
@nadrane
nadrane / connect.js
Last active October 8, 2019 07:27
Create your own react-redux connect
import React, { Component } from "react";
import { render } from "react-dom";
import Hello from "./Hello";
import { createStore } from "redux";
const shallowEqual = require("shallow-equal/objects");
const store = createStore((oldState={}, action) => {
return Object.assign(oldState, { storeValue: action.storeValue })
});