Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🌊 🇯🇵

Andrew Pagan drewkiimon

💭
🌊 🇯🇵
View GitHub Profile
@drewkiimon
drewkiimon / [title].tsx
Last active Feb 25, 2021
Dynamic MDX file import
View [title].tsx
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 / stringShift.js
Created Apr 14, 2020
Leetcode 30 Day Challenge - Day 14
View stringShift.js
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];
}