Skip to content

Instantly share code, notes, and snippets.

View kmmbvnr's full-sized avatar
💭
#StopPutin #StopWar

Mikhail Podgurskiy kmmbvnr

💭
#StopPutin #StopWar
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'socket'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Fix no-tty error
# if there a line that only consists of 'mesg n' in /root/.profile, replace it with 'tty -s && mesg n'
config.vm.provision :shell,
:inline => "(grep -q -E '^mesg n$' /root/.profile && sed -i 's/^mesg n$/tty -s \\&\\& mesg n/g' /root/.profile && echo 'Ignore the previous error about stdin not being a tty. Fixing it now...') || exit 0;"
@kmmbvnr
kmmbvnr / import_request.py
Created June 26, 2013 08:41
Excel to Oracle loading sample
# -*- mode:python; coding: utf-8 -*-
"""
Usage:
import_request <username>
"""
import cx_Oracle
import getpass
import openpyxl as px
from datetime import datetime, time
from docopt import docopt
@kmmbvnr
kmmbvnr / TimeSyncService.java
Created April 25, 2013 03:21
Simple Time Sync algorithm impl
package com.kmmbvnr;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Simple Time Sync algorithm impl
* Based on http://www.mine-control.com/zack/timesync/timesync.html
*/
@kmmbvnr
kmmbvnr / .classpath
Created January 30, 2012 07:13
Android project template
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="gen"/>
@kmmbvnr
kmmbvnr / .gitignore
Created July 3, 2011 13:22
Project euler solutions in Google GO
*/.go
@kmmbvnr
kmmbvnr / .gitignore
Created March 1, 2011 11:37
ASP.NET MVC3 Project Template
*.suo
*.user
App_Data/
bin/
obj/
packages/
packages.config
@kmmbvnr
kmmbvnr / manage.py
Created February 17, 2011 04:26
Clean and simple ve setup
#!/usr/bin/env python
try:
from ve_setup import use_virtualenv
except ImportError:
import urllib
urllib.urlretrieve("http://tiny.cc/ve-setup", 've_setup.py')
from ve_setup import use_virtualenv
use_virtualenv(['--distribute', "python"], requirements="requirements.pip", activate=True)
# application code
@kmmbvnr
kmmbvnr / .gitignore
Created January 20, 2011 05:17
Empty django project
.ve
dev.db
secret.txt
*.pyc
We couldn’t find that file to show.