Skip to content

Instantly share code, notes, and snippets.

View vst's full-sized avatar
😳

Vehbi Sinan Tunalioglu vst

😳
View GitHub Profile
@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 / 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 / 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 / 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 / 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):
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}"
import org.moeaframework.core.Algorithm;
import org.moeaframework.core.Solution;
import org.moeaframework.core.spi.AlgorithmFactory;
import org.moeaframework.core.variable.Grammar;
import org.moeaframework.problem.AbstractProblem;
import org.moeaframework.util.grammar.ContextFreeGrammar;
import org.moeaframework.util.grammar.Parser;
import org.renjin.sexp.SEXP;
import javax.script.ScriptEngine;
from enum import Enum
from math import inf
class Multiplicity(Enum):
"""
Defines multiplicities.
>>> Multiplicity.OPTIONAL.min
0
from enum import Enum
from decimal import Decimal
class Currency:
"""
Defines an ISO 4217 compatible currency object model.
>>> Currency("XXX", "My Currency", 2)
<Currency XXX 2 My Currency>
@vst
vst / setup.py
Last active December 29, 2015 09:39
"""
Provides the setup module.
"""
from ___YOURMODULE___ import __version__
from setuptools import setup
from setuptools import find_packages
import os
## The absolute directory path: