Skip to content

Instantly share code, notes, and snippets.

View alexitaylor's full-sized avatar
🚀
building cool things

Alexi Taylor alexitaylor

🚀
building cool things
View GitHub Profile
@alexitaylor
alexitaylor / react.svg
Created August 5, 2020 21:38
React SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexitaylor
alexitaylor / more-horizontal.svg
Created February 28, 2020 21:54
More Horizontal Icon
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexitaylor
alexitaylor / more-horizontal.svg
Last active February 28, 2020 21:46
More horizontal Icon
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexitaylor
alexitaylor / more.svg
Last active February 28, 2020 21:50
More Icon SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexitaylor
alexitaylor / memoize.ts
Last active October 18, 2022 17:58
TypeScript Memoize Util Function. Caches the result of async functions. Function's arguments are converted into hash key. Plus tests.
/**
* createCacheKeyFromArgs
*
* @desc Creates a cache key from fn's arguments.
*
* @param {any[]} args Arguments from fn being memoized.
* @return {string} Returns a cache key.
*/
export const createCacheKeyFromArgs = (args: any[]) =>
args.reduce((cacheKey, arg) => (cacheKey += `_${typeof arg === 'object' ? JSON.stringify(args) : `${arg}`}_`), '');
<template>
<div id="app">
<p>
Pending: {{ $store.state.getInfoPending }}
</p>
<p>
{{ $store.state.getInfoData }}
</p>
</div>
</template>
@alexitaylor
alexitaylor / computeMaxCallStackSize.js
Created July 26, 2017 20:38
Are you curious how many recursive calls you can make on your JavaScript engine?
var i=0;
function computeMaxCallStackSize() {
i++;
computeMaxCallStackSize();
}
computeMaxCallStackSize();
@alexitaylor
alexitaylor / vanilla-js-plugin.js
Created July 18, 2017 17:33 — forked from cferdinandi/vanilla-js-plugin.js
My starter template for vanilla JavaScript plugins.
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
} else if ( typeof exports === 'object' ) {
module.exports = factory(root);
} else {
root.myPlugin = factory(root);
}
})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) {
/**
* @param {string} s
* @param {string} t
* @return {boolean}
*/
var isSubsequence = function(s, t) {
var indexCount = 0;
if (s === "") {
return true;