Skip to content

Instantly share code, notes, and snippets.

View ammiiamm's full-sized avatar

ammiiamm

View GitHub Profile
If you want to merge all text files or concatenate multiple texts which are in the same folder to only one bulky file,
the following script can serve your need!
Instruction:
1. Copy following code to notepad.
2. Save as [filename].bat and put it in the [textfile].csv folder.
3. Double click at [filename].bat to merging all texts.
4. A new file with Prefix Merge_yyyyMMdd.txt will be created where you will find all your data inside that file.
Note:
@ammiiamm
ammiiamm / spark-on-colaboratory.ipynb
Last active January 14, 2019 03:41
Spark on Colaboratory.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ammiiamm
ammiiamm / gist:7e78edf040cdb42d417238438d825a7d
Last active July 31, 2018 18:19
Set up GOLANG Environment Variables on MacOS
Make sure that you follow the guideline from this Medium >> https://medium.com/golang-learn/quick-go-setup-guide-on-mac-os-x-956b327222b8
For the $GOPATH and $PATH environment, run below commands:
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
@ammiiamm
ammiiamm / gist:112a5c30684fd1726ff52d26d27b41f7
Created July 3, 2018 16:28
Auto download files from diw by using request
import requests
for i in range(12,97):
for j in range(1,36):
url = 'http://www2.diw.go.th/factory/'+str(i)+'-'+str(j)+'-.xls'
print (url)
fileName = str(i)+'-'+str(j)+'-.xls'
req = requests.get(url)
file = open(fileName, 'wb')
for chunk in req.iter_content(100000):
import tweepy
import json
import requests
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
api_key = '***'
api_secret = '***'

Keybase proof

I hereby claim:

  • I am ammiiamm on github.
  • I am ammiiamm (https://keybase.io/ammiiamm) on keybase.
  • I have a public key ASAlSr0QSj8jO7HGfDT85jVwW2i9eWETyee2kGxXZ8vDjgo

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.ajax({
type : "GET",
url : "https://iapi.bot.or.th/Stat/Stat-ReferenceRate/DAILY_REF_RATE_V1/?start_period=2002-01-12&end_period=2002-01-15",