Skip to content

Instantly share code, notes, and snippets.

View vst's full-sized avatar
😳

Vehbi Sinan Tunalioglu vst

😳
View GitHub Profile
from collections import OrderedDict
import base64
import json
import urllib2
import sys
import datetime
## Define Bitbucket API endpoints:
ENDPOINT_REPOSITORIES = "https://api.bitbucket.org/2.0/repositories/{handle}?page={page}"
@vst
vst / changelog.sh
Created November 3, 2014 03:30
Changelog preperation script for Git repositories
#!/bin/bash
########################################################################
# Description:
# Produces custom ChangeLog file contents out of the "git log"
#
# Usage:
# sh changelog.sh
#
# Usage (Save output):
@vst
vst / randstr.js
Created June 30, 2014 09:49
Javascript function which produces random strings
/**
* Constructs a random string with the given length and character set.
*
* If no character set is provided, default character set will be used.
*/
function randstr (length, charset) {
// (Re)define the charset:
charset = charset || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
// construct and return:
@vst
vst / mypcal.sh
Last active August 29, 2015 14:01
Creates and views a yearly calendar
#!/bin/bash
# For Mac OSX :|
pcal -w -P a4 -F 1 -t Garamond -d Garamond | open -a preview -f
@vst
vst / vst-tmdfile.el
Last active August 29, 2015 13:57
Creates a temporary file at the configured destination #emacs
;; Declares the variable for the destination folder.
(defvar *vst-tmdfile-folder* "/tmp")
;; Defines the function which creates a temporary markdown file in the
;; destination folder.
(defun vst-tmdfile ()
(interactive)
(find-file (format "%s/%s.md"
*vst-tmdfile-folder*
(format-time-string "%Y-%m-%dT%T"))))
@vst
vst / cransync.sh
Last active August 29, 2015 13:57
Creates a folder named `CRAN` in the same folder as this script and mirrors/syncs master CRAN repository to the `CRAN` folder.
#!/bin/bash
## **Description:** Creates a folder named `CRAN` in the same folder
## as this script and mirrors/syncs master CRAN repository to the
## `CRAN` folder.
# Get the script path:
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
# Get the mirror path:
@vst
vst / todoist.py
Last active March 17, 2018 22:01
A command line tool for Todoist
## Got this script initially from https://gist.github.com/kbl/5970131
###########
# IMPORTS #
###########
import ConfigParser
import argparse
import json
import os
@vst
vst / document.tex
Created October 23, 2012 10:21
LaTeX Template for starting documents quickly
%% Set the overall document-class properties:
\documentclass[12pt,a4paper]{article}
%% Use and configure packages:
\usepackage{color}
\usepackage[T1]{fontenc}
\usepackage[top=3cm,left=2.5cm,right=2.5cm,bottom=3cm]{geometry}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{palatino}
@vst
vst / mixins.py
Created September 19, 2012 04:58
Some Django model mixins
# Copyright (c) 2012, Vehbi Sinan Tunalioglu <vst@vsthost.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
@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