Skip to content

Instantly share code, notes, and snippets.

View drewkiimon's full-sized avatar
💭
🌊 🇯🇵

drewbie. drewkiimon

💭
🌊 🇯🇵
View GitHub Profile
@drewkiimon
drewkiimon / stringShift.js
Created April 14, 2020 16:11
Leetcode 30 Day Challenge - Day 14
var stringShift = function(s, shift) {
var move = 0,
s= s.split('');
for (var i = 0; i < shift.length; i ++) {
if (shift[i][0] === 0) {
move -= shift[i][1];
} else if (shift[i][0] === 1) {
move += shift[i][1];
}
@drewkiimon
drewkiimon / [title].tsx
Last active February 25, 2021 18:30
Dynamic MDX file import
import React, { useEffect, useState } from "react";
import { useRouter } from "next/router";
import { MDXProvider } from "@mdx-js/react";
const components = {
h1: (props: string) => <h1 style={{ color: "tomato" }} {...props} />,
};
const Placeholder: React.FC = () => {
return <>Loading</>;
@drewkiimon
drewkiimon / highcharts-grouped-stacked-bar-chart-v2.markdown
Created July 29, 2021 20:02
[Highcharts] Grouped Stacked Bar Chart v2
@drewkiimon
drewkiimon / highcharts-grouped-stacked-bar-chart-v2.markdown
Created July 30, 2021 15:29
[Highcharts] Grouped Stacked Bar Chart v2
@drewkiimon
drewkiimon / highcharts-grouped-stacked-bar-chart-v2.markdown
Created July 30, 2021 17:57
[Highcharts] Grouped Stacked Bar Chart v2
@drewkiimon
drewkiimon / leetcode-567.js
Created February 12, 2022 05:30
Leetcode Permutation in String problem 567
/*
Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise.
In other words, return true if one of s1's permutations is the substring of s2.
*/
const checkInclusion = (s1, s2) => {
if (s1.length > s2.length) return false;
const s1Dict = {};
@drewkiimon
drewkiimon / amexOffers.js
Last active September 15, 2023 16:29
Accept all Amex Offers
/*
* 1. Go to https://global.americanexpress.com/offers/eligible
* 2. Open up console
* 3. Paste this script in and click "Enter"
*/
(() => {
const nodes = Array.from(document.querySelectorAll(".offer-cta")).filter((n) => n.innerText === "Add to Card")
const nodeCount = nodes.length;
const SECONDS = 1000;