Skip to content

Instantly share code, notes, and snippets.

@vestel
vestel / something.xml
Created March 12, 2012 13:32
get-selections autonose
<?xml version="1.0" ?><selections command="run" interface="http://gfxmonk.net/dist/0install/autonose.xml" xmlns="http://zero-install.sourceforge.net/2004/injector/interface"><selection id="sha1new=86a0fe7455d1d3d10404c8ab4f0a4799187e0663" interface="http://gfxmonk.net/dist/0install/argh.xml" released="2011-01-04" version="0.14.0"><manifest-digest sha1new="86a0fe7455d1d3d10404c8ab4f0a4799187e0663"/><environment insert="" mode="append" name="PYTHONPATH" separator=":"/><requires interface="http://gfxmonk.net/dist/0install/argparse.xml"/></selection><selection id="sha1new=35f3e7199e198e331ccf5b359aac858e2028d7fd" interface="http://gfxmonk.net/dist/0install/argparse.xml" released="2011-01-04" version="1.1"><manifest-digest sha1new="35f3e7199e198e331ccf5b359aac858e2028d7fd"/><environment insert="" mode="append" name="PYTHONPATH" separator=":"/></selection><selection id="sha1new=4443b16cba9111825cff732645b24ae97342bf7a" interface="http://gfxmonk.net/dist/0install/autonose.xml" released="2011-10-08" version="0.2.2"><
@vestel
vestel / test.html
Created February 22, 2012 14:28
LESS example
<html>
<head>
<title>Test something</title>
<link rel="stylesheet/less" type="text/css" href="test_style.less">
<script src="http://lesscss.googlecode.com/files/less-1.2.1.min.js" type="text/javascript"></script>
</head>
<body>
<h2> This header is green because of less color syntax </h2>
<p class="redone">Test</p>
</body>
@vestel
vestel / test.py
Created January 31, 2012 15:37
Inheritance and MRO
from __future__ import generators
class A(object):
""" Normal class """
def su(self):
self.su_result = []
self.su_result.append("A:Start")
mro = list(self.__class__.__mro__)[:-1]
mro.reverse()
for i in mro:
@vestel
vestel / gist:1024571
Created June 14, 2011 09:22
Letter (fix)
Dear Sir/Madam!
# Обязательно пустая строка после приветствия.
# Если посылать в Ригу, можешь сразу посылать на Madam
My name is Olga Zdanchuk. From a recruiters web-site workingday.lv, I learned that you are searching for a Python developer.
I am interested in this position and I believe that my education and background are appropriate for this role.
I got Bachelor degree in Computer Science at Transport and Telecommunication Institute, in 2009.
After that I have been studying for 2 years in University of Latvia.
Now I am Master in Computer Science and will get my diploma on June, 30th.
#include <stdio.h>
#include <string.h>
#include <openssl/md5.h>
//char SAMPLE[33]="66d9978935150b34b9dc0741bc642be2\0";
/* This is md5 hash for my task. For a testing purpose
* in single-threaded code, I've used a md5 hash for
* word "TEST" to determine end of processing.
*/
*.swp
*.pyc
*.pyo
*.py~
@vestel
vestel / .vimrc
Last active September 25, 2015 13:34
.vimrc
set nocompatible
" Recently accessed projects menu (project plugin)
set viminfo^=!
set ruler showcmd number nowrap " Ruler, linenumbers , wrapping off
set ts=4 sts=4 et sw=4 smarttab " Defauls: 4 spaces as tab, autoindent, smarttabs
set ignorecase smartcase hlsearch incsearch " Search settings
# This is special script to detect jpg files' exif content. Usage 'script.rb filename.jpg'
require 'rubygems'
require 'exifr'
image_file = ARGV.first
exif_info = nil
exif_info = EXIFR::JPEG.new(image_file)
if exif_info.exif? then
public void testAccountExceptionDiffCaseFailed() {
try {
Account a = new Account("Hacker");
fail(a.getName() + " isn't legal name");
} catch (AccountException e) {
assertEquals(e.getMessage(),
AccountException.NAME_TOO_SIMPLE);
}
}
package sef.module7.activity;
import java.util.Calendar;
/**
* Represents an implementation of the Currency interface. The
* equality test for this currency implementation requires that the
* value and the name of the denomination must be true in order to
* be considered equal.
*