Skip to content

Instantly share code, notes, and snippets.

View ldong's full-sized avatar
❤️
Love & Peace

Alan Dong ldong

❤️
Love & Peace
  • Sunnyvale, CA
View GitHub Profile
@ldong
ldong / vim.rb
Last active August 29, 2015 13:56 — forked from vesln/vim.rb
Vim formula for max os using homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
head 'https://vim.googlecode.com/hg/'
# This package tracks debian-unstable: http://packages.debian.org/unstable/vim
url 'http://ftp.debian.org/debian/pool/main/v/vim/vim_7.4.161.orig.tar.gz'
sha1 '111e9a237fa240895db013c1e546dd02580a2940'
# We only have special support for finding depends_on :python, but not yet for
"""
Python Startup File (from https://gist.github.com/955154)
Add this file to ~/.pythonrc.py to add history between sessions and
auto-completion via the ESC key to the interactive Python interpreter. After
adding this file, put something like the following line in your .bash_profile:
export PYTHONSTARTUP=$HOME/.pythonrc.py
Requires a recent version of Python and the readline package, which you can
@ldong
ldong / ui_testing_resources.md
Last active August 29, 2015 14:01 — forked from klamping/Resources.md
UI Testing resources
@ldong
ldong / uri.js
Last active August 29, 2015 14:02 — forked from jlong/uri.js
var parser = document.createElement('a');
// var parser = document.querySelector('CSS_SELECTOR')
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
@ldong
ldong / headless_browsers.md
Last active August 29, 2015 14:03 — forked from evandrix/README.md
A list of headless browsers

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@ldong
ldong / md_to_rst.sh
Last active August 18, 2019 18:26 — forked from hugorodgerbrown/md_to_rst.sh
convert markdown to rst files
# This script was created to convert a directory full
# of markdown files into rst equivalents. It uses
# pandoc to do the conversion.
#
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/
# 2. Copy this script into the directory containing the .md files
# 3. Ensure that the script has execute permissions
# 4. Run the script
#
# By default this will keep the original .md file
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@ldong
ldong / curl.md
Created August 30, 2014 03:06 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
class Node(object):
def __init__(self, name, lc=None, rc=None):
self.name = name
self.lc = lc
self.rc = rc
self.rn = None
# THE MEAT OF THE PROBLEM
@staticmethod
def link_rn(level_list):