Skip to content

Instantly share code, notes, and snippets.

View TheGU's full-sized avatar
🎯
Focusing

Pattapong J. TheGU

🎯
Focusing
  • 021
  • Bangkok, Thailand
  • X @thegu
View GitHub Profile
@TheGU
TheGU / uploader.go
Created September 11, 2015 10:07
Golang to upload file to google drive with progress bar using Google API
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
@TheGU
TheGU / crawl_and_download.py
Last active August 29, 2015 14:27
a script to crawl a page then download all file to local disk (http://pattapongj.com/2015/08/11/python-crawler-and-download/)
# -*- coding: utf-8 -*-
import requests
import re
import urlparse
import urllib
import os
from bs4 import BeautifulSoup
base_url = "http://downloads.khinsider.com/game-soundtracks/album/patapon-2"
crawl_link_string = "Download"
@TheGU
TheGU / URLSequenceShortener.js
Created June 16, 2015 02:47
Create shorten URL like counting in base 62
var shortener = function(seq) {
var new_str = "";
var chars = "abcdefghijklmnopqrstuvxzwyABCDEFGHIJKLMNOPQRSTUVXZWY1234567890";
while (seq > 0) {
var k = seq % chars.length;
if (k == 0) {
k = 62;
seq--;
}
seq = Math.floor(seq / chars.length);