Skip to content

Instantly share code, notes, and snippets.

View markhker's full-sized avatar

Mark Hkr markhker

View GitHub Profile
@markhker
markhker / zillowImageDownloader.js
Created October 20, 2021 00:50
Zillow Download images
/**
* STEP 1: Click on the first image to open the image lightbox carousel
*/
/**
* STEP 2: Open Dev Tools Console.
* Copy and paste code below, replace the query variables if they changed
* This will download the images in webp and jpg
@markhker
markhker / context.ts
Created June 11, 2021 00:32 — forked from bodokaiser/context.ts
React Hook integration for AWS Amplify Auth
import React from "react"
import { CognitoUser } from "@aws-amplify/auth"
import { useAuth } from "./hooks"
import { SignInInput } from "./types"
interface AuthState {
user: CognitoUser | null
signIn(input : SignInInput): Promise<void>
signOut(): Promise<void>
@markhker
markhker / 1.rreaddir.js
Created February 9, 2021 02:35 — forked from timoxley/1.rreaddir.js
async/await recursive fs readdir
import { join } from 'path'
import { readdir, stat } from 'fs-promise'
async function rreaddir (dir, allFiles = []) {
const files = (await readdir(dir)).map(f => join(dir, f))
allFiles.push(...files)
await Promise.all(files.map(async f => (
(await stat(f)).isDirectory() && rreaddir(f, allFiles)
)))
return allFiles

Keybase proof

I hereby claim:

  • I am markhker on github.
  • I am markhkr (https://keybase.io/markhkr) on keybase.
  • I have a public key ASAuiIwpchDYGNxgL9k8zRaIAmywBHJ54HzR2o2AcZt-rgo

To claim this, I am signing this object:

A
A + Certified
A-110
A-122
A-123
A-133
A-frames
A-GPS
A/B Testing
A/R analysis
@markhker
markhker / DefaultKeyBinding.dict
Created May 18, 2020 19:21 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@markhker
markhker / resolve-tsconfig-path-to-webpack-alias.js
Created March 12, 2020 17:37 — forked from nerdyman/resolve-tsconfig-path-to-webpack-alias.js
Convert TypeScript tsconfig paths to webpack alias paths
const { resolve } = require('path');
/**
* Resolve tsconfig.json paths to Webpack aliases
* @param {string} tsconfigPath - Path to tsconfig
* @param {string} webpackConfigBasePath - Path from tsconfig to Webpack config to create absolute aliases
* @return {object} - Webpack alias config
*/
function resolveTsconfigPathsToAlias({
tsconfigPath = './tsconfig.json',
@markhker
markhker / .gitmessage
Created September 7, 2018 20:24 — forked from RichardBronosky/.gitmessage
Use this Git commit message template to write better commit messages.
Replace this line with imperative summary
An awesome description of WHY you did this work, not HOW/WHAT it does.
The diff attached to commit should describe implementation (HOW)
well-enough.
# [TICKET-12]
#------------------------------------------------^---------------------^
# 50^ 72^
@markhker
markhker / add_two_times.js
Created November 9, 2017 22:42 — forked from joseluisq/add_two_times.js
Sum two times values HH:mm:ss with javascript
/**
* Sum two times values HH:mm:ss with javascript
* Usage:
* > addTimes('04:20:10', '21:15:10');
* > "25:35:20"
*
* @param {string} start
* @param {string} end
* @returns {String}
*/