Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Pre-requisites
sudo apt-get -y update
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim
# Download and install rbenv
cd ~
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
@lazywei
lazywei / parser.rb
Last active December 20, 2015 09:49
Yahoo! buy parser
require 'nokogiri'
require 'typhoeus'
url = "http://tw.buy.yahoo.com/gdsale/gdsale.asp?gdid=3791541"
r = Typhoeus.get(url)
doc = Nokogiri::HTML(r.body)
specs = {}
@lazywei
lazywei / aoh.coffee
Last active December 17, 2015 22:59
Attack on hubot / 進擊的 hubot
# Description:
# Attack on Hubot AT hipchat.
#
# Commands:
# hubot aoh help - Show rules.
# hubot aoh init me - Create or reset certain user.
# hubot aoh atk user - Attack user.
# hubot aoh hunt - hunt something.
# hubot aoh find user - Display user infomation.
@lazywei
lazywei / bill.rb
Created February 14, 2013 08:10
自動抓取 emome 上未出帳的每月上網使用流量
# encoding: UTF-8
require "nokogiri"
require "mechanize"
p "Phone number:"
uid = gets.chomp
p "Password:"
pw = gets.chomp
base_url = "http://bms.emome.net/proxy/mbms/"