Skip to content

Instantly share code, notes, and snippets.

@forrestchang
forrestchang / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@forrestchang
forrestchang / flatten.py
Created February 22, 2017 13:08
Flatten (an irregular) list of lists in Python
# http://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists-in-python
def flatten(nested_list):
for i in nested_list:
if isinstance(i, collections.Iterable) and not isinstance(i, (str, bytes)):
yield from flatten(i)
else:
yield i
@forrestchang
forrestchang / chain.py
Last active February 22, 2017 13:23
itertools.chain(*iterables)
def chain(*iterables):
# chain('ABC', 'DEF') => A B C D E F
for it in iterables:
for element in it:
yield element
@forrestchang
forrestchang / gitstars.json
Last active February 6, 2018 03:39
github stars manager for production
{"tags":[],"lastModified":1517888367215}
@forrestchang
forrestchang / scroll_to_hide_headers.js
Created April 18, 2019 03:18
Scroll to hide headers
const throttle = (callback, limit) => {
let timeoutHandler = null
return () => {
if (timeoutHandler == null) {
timeoutHandler = setTimeout(() => {
callback()
timeoutHandler = null
}, limit)
}
}
;;; ~/.doom.d/+bindings.el -*- lexical-binding: t; -*-
;; Unbind keys
(map! :leader
"A" nil
"X" nil
)
;; Leader key
We couldn’t find that file to show.
curl --location --request POST 'https://us-central1-ldr-prod.cloudfunctions.net/api/sign' \
--header 'authority: us-central1-ldr-prod.cloudfunctions.net' \
--header 'accept: application/json, text/plain, /' \
--header 'accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
--header 'content-type: application/json' \
--header 'dnt: 1' \
--header 'origin: https://lovedeathandart.com/' \
--header 'referer: https://lovedeathandart.com/' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \