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
@ldong
ldong / python_tip_solutions.md
Last active August 29, 2015 13:57
Solution for PythonTip Coding Challenge # http://pythontip.sinaapp.com/coding

PythonTip solutions

# Title: PythonTip Coding Challenge Solutions
# Author: Lin Dong
# Url: http://pythontip.sinaapp.com/coding
# Goal: Trying to achieve solution with minimal effort/ codes
# Feel free to fork it and make improvements
  1. just print a+b print a+b
@ldong
ldong / pythonChallenge.md
Last active August 8, 2024 21:30
Python Challenge walkthrough
@ldong
ldong / pythonChallenge2.py
Created April 1, 2014 19:53
Python Challenge Level 2
#!/usr/bin/env python2
### Original Repo http://hacked2bits.com/software/python-challenge/
file_name = raw_input("File name: ")
with open(file_name, 'r') as f:
file_data = f.read()
characters = []
data = list(file_data)
"""
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
#!/usr/bin/env python
import sys
CASE1 = 1
CASE2 = 5
CASE3 = 7
WORD1 = 'Fizz'
WORD2 = 'Buzz'
WORD3 = 'Whizz'
def filter(num):
if str(CASE1) in str(num):
@ldong
ldong / headless_browser_practice.md
Last active August 29, 2015 14:01
Useful links for running headless browsers

Headless Broswer Practices

troubleshooting

http://phantomjs.org/troubleshooting.html

###Output cookies to file phantomjs --cookies-file=cookies.txt test.js

JavaScript for JSON

JSON.stringify turns an object in to a JSON text and stores that JSON text in a string.

## Install ruby on mac by using RVM
Steps:
1. curl -L https://get.rvm.io | bash -s stable
2. Install Homebrew `ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"`
3. rvm list known
@ldong
ldong / ui_testing_resources.md
Last active August 29, 2015 14:01 — forked from klamping/Resources.md
UI Testing resources