Skip to content

Instantly share code, notes, and snippets.

View tianhengzhou's full-sized avatar

Tianheng Zhou tianhengzhou

View GitHub Profile
@tianhengzhou
tianhengzhou / paypalshipnow_module.py
Created September 1, 2016 02:26
A script use to add recruiter on LinkedIn
import time
from selenium import webdriver
# from urlparse import urlparse
# from urlparse import parse_qs
from selenium.webdriver.support.ui import WebDriverWait
# from selenium.common.exceptions import NoSuchElementException
# from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
# from selenium.webdriver.common.keys import Keys
<xml><input id="input" type="text">
<button onclick="runFibonacci()">Submit</button>
<div id="result">[]</div>
<script>
function runFibonacci(){
var N = document.getElementById('input').value,
result = document.getElementById('result'),
array = [];
var f_sequence = fibonacci();
for (var i = 0; i < N; i++){
@tianhengzhou
tianhengzhou / The Technical Interview Cheat Sheet.md
Created March 23, 2016 17:19 — 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.
@tianhengzhou
tianhengzhou / hapijs-rest-api-tutorial.md
Created February 19, 2016 02:27 — forked from agendor/hapijs-rest-api-tutorial.md
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
/*
* Request: Javascript
*
* I would like to learn some basic concepts in JavaScript. Just as example, making a stopWatch and creating a racing game with few players which will have start and stop time for each player and choose one winner from them using the stopWatch object.
*/
// Design and Code a StopWatch
// Sample Use Case:
// var sw = new StopWatch();
// sw.start().stop().start().log();
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query