Skip to content

Instantly share code, notes, and snippets.

View vst's full-sized avatar
😳

Vehbi Sinan Tunalioglu vst

😳
View GitHub Profile
@vst
vst / cftmc.csv
Created September 5, 2012 04:51
Month Codes for Constructing Commodities Futures Tickers
no name abbr code
1 january jan F
2 february feb G
3 march mar H
4 april apr J
5 may may K
6 june jun M
7 july jul N
8 august aug Q
9 september sep U
@vst
vst / Rprofile.R
Created February 8, 2012 06:02
My .Rprofile
## Increase the width for wider screens:
options("width"=140)
## Change the prompt:
options(prompt="R> ")
## Set digits to 4 while printing:
options(digits=4)
## Set penalty for scientific notation while printing:
@vst
vst / remoteSource.R
Created February 8, 2012 03:30
Retrieves and evaluates remote R sources including those served over secure http (https) connections. Requires RCurl package.
##' Retrieves and evaluates a remote R source file.
##'
##' @param file defines a URL as the remote source file path
##' @param local indicates if the remote source should be evaluated in
##' the environment which calls remoteSource. If FALSE (default),
##' evaluated in the global environment.
##' @param verbose indicates if verbose output should be printed.
##' @param echo indicates if the source should be echoed before
##' evaluation.
##' @return result of evaluating the remote source.
@vst
vst / sg.csv
Created February 8, 2012 03:02
CSV file of Singapore districts. "code" refers to district code, "name" to district name, and "zips" to the first to characters of the zipcodes belonging to the particular district.
code name zips
1 Raffles Place, Cecil, Marina, People's Park 01
1 Raffles Place, Cecil, Marina, People's Park 02
1 Raffles Place, Cecil, Marina, People's Park 03
1 Raffles Place, Cecil, Marina, People's Park 04
1 Raffles Place, Cecil, Marina, People's Park 05
1 Raffles Place, Cecil, Marina, People's Park 06
2 Anson, Tanjong Pagar 07
2 Anson, Tanjong Pagar 08
3 Queenstown, Tiong Bahru 14
@vst
vst / parseEBSstatement.py
Created January 11, 2012 05:38
Parses an EBS statement retrieved from secure.ebs.in and produces a simpler representation for bank account management.
##############################################################################
# Copyright 2012 Vehbi Sinan Tunalioglu #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
@vst
vst / README.rst
Created January 11, 2012 04:34
Automated management of copyright and licensing notes for individual source code files.

How-to Manage Copyright Notice for Individual Source Code Files

If you want to manage the copyright and licensing information of your source code files automatically, you may use headache tool.

Steps to apply:

@vst
vst / xts_json.R
Created November 23, 2011 08:32
Marshalling between xts objects and JSON representations of xts objects.
##' Declares the generic as.json method.
##'
##' @param x the object to be marshalled to JSON
##' @param ... extra arguments to the actual function
##' @return a JSON representation of the consumed object.
##' @export
as.json = function (x, ...) {
UseMethod("as.json")
}