Skip to content

Instantly share code, notes, and snippets.

View timchunght's full-sized avatar

Timothy Chung timchunght

View GitHub Profile
@timchunght
timchunght / feedly_export_saved_for_later
Last active August 29, 2015 14:06 — forked from bradcrawford/feedly_export_saved_for_later
feedly saved articles crawler. Simple script that exports a users "Saved For Later" list out of Feedly as a JSON string
// Simple script that exports a users "Saved For Later" list out of Feedly
// as a JSON string.
//
// This was intended for use in the Google Chrome's "Inspector" tool so your
// mileage may vary if used in other contexts.
//
// Format of JSON is as follows:
// [
// {
// title: "Title",
#! /usr/bin/env ruby
# usage:
# $ das_download.rb email password [download_directory]
require 'mechanize'
# gem 'mechanize-progressbar'
email = ARGV[0] or raise('Please provide the email address for your account')
password = ARGV[1] or raise('Please provide the password for your account')
path = (ARGV[2] || './').gsub /\//,''

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@timchunght
timchunght / Vagrantfile
Created September 25, 2015 20:35 — forked from dommmel/Vagrantfile
Vagrantfile for Ruby on Rails application development (rbenv, postgres, node.js)
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
set -e
set -x
cd
sudo apt-get update -y
sudo apt-get install \
@timchunght
timchunght / static-site-nginx-setting
Created October 17, 2015 06:32
static-site-nginx-setting
server {
listen 80;
server_name localhost;
rewrite_log on;
location / {
autoindex on;
alias /var/www/blsite/;
}
@timchunght
timchunght / .gitignore
Last active October 22, 2015 06:48 — forked from ryoco/.gitignore
pdf to image with Go
/*.swp
/*.pdf
/*.png
.DS_Store
class WebkitToPng
def self.create(urls, options={})
urls.each do |url|
puts "convert #{url} to #{options[:dir]}"
url.sub!('//', "//#{options[:auth]}@") if options[:auth]
op = "-F -D #{options[:dir]} -o #{url.split('/').last}"
op += " --user-agent='#{user_agent}'" if options[:mobile]
exec(url, op)
end
<?xml version='1.0' encoding='UTF-8'?>
<hudson.tasks.Shell_-DescriptorImpl>
<shell>/tmp/jenkins/citman_shell_wrapper</shell>
</hudson.tasks.Shell_-DescriptorImpl>
@timchunght
timchunght / gist:c257b71b82603d04c6e78a352226b77a
Created April 20, 2017 06:25 — forked from nl5887/gist:f88ca64b67f7dce3690c
Dynamically returns a zip file consisting of multiple Amazon S3 objects
// download zipfile
func ZipHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
token := vars["token"]
db, err := sql.Open("mysql", config.DSN)
if err != nil {
panic(err.Error()) // Just for example purpose. You should use proper error handling instead of panic
}
@timchunght
timchunght / gist:950a122177654ab0768c5a3a175ffeff
Created April 20, 2017 06:25 — forked from nl5887/gist:f88ca64b67f7dce3690c
Dynamically returns a zip file consisting of multiple Amazon S3 objects
// download zipfile
func ZipHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
token := vars["token"]
db, err := sql.Open("mysql", config.DSN)
if err != nil {
panic(err.Error()) // Just for example purpose. You should use proper error handling instead of panic
}