Skip to content

Instantly share code, notes, and snippets.

@mgalushka
mgalushka / MoneyTest.cpp
Created November 4, 2015 23:42
Money class manipulation test
#include <iostream>
#include "gtest/gtest.h"
#include "glog/logging.h"
#include "Change.h"
#include "Money.h"
TEST(MoneyTest, equals) {
EXPECT_EQ(change::Money(123, 44), change::Money(123, 44));
class wait_for_page_load(object):
def __init__(self, browser, url):
self.browser = browser
self.url = url
def __enter__(self):
self.old_page = self.browser.find_element_by_tag_name('html')
def page_has_loaded(self):
@mgalushka
mgalushka / gist:faceb697807483e5927c
Created December 4, 2014 16:03
Unsafe code in OpenRefine
import com.google.refine.expr.CellTuple;
import com.google.refine.expr.Evaluable;
import com.google.refine.jython.JythonEvaluable;
import com.google.refine.model.Cell;
import com.google.refine.model.Project;
import com.google.refine.model.Row;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.Properties;
config defaultToCurrentScreen true
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
config windowHintsDuration 5
bind esc:cmd hintfac
alias mon-laptop 1680x1050
alias mon-monitor 2560x1600
@mgalushka
mgalushka / .bashrc
Created October 23, 2014 00:18
Display branch/bookmark for both git/mercurial in command prompt
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
function hg_branch() {
#hg branch 2> /dev/null | awk '{ printf "\033[37;0m\033[35;40m" $1 }'
hg bookmarks 2> /dev/null | awk '/\*/ { printf " (" $2 ")"}'
}
PS1="$GREEN\u@\h$NO_COLOR:\w$YELLOW\$(parse_git_branch)$YELLOW\$(hg_branch)$NO_COLOR\$ "