Skip to content

Instantly share code, notes, and snippets.


Mateusz Haligowski mhaligowski

View GitHub Profile
mhaligowski / gist:7529489
Created Nov 18, 2013
The worst piece of code ever seen
View gist:7529489
// funkcja nadpisana na potrzeby testów <- Polish for: Written for the sake of tests
* @deprecated Use {@link #getProperty(PropertyName)}.
protected String getProperty(String propertyName) {
return super.getProperty(propertyName);
mhaligowski / dsl.js
Created Oct 9, 2013
Extending angular-scenario for using jQuery in tests
View dsl.js
'use strict'
angular.scenario.dsl('restartDB', function() {
return function() {
return this.addFutureAction('restartDB', function($window, $document, done) {
var $ = $window.$; // this is for jQuery
return done();
mhaligowski / gist:6533166
Created Sep 12, 2013
My ultra-cool terminal PS
View gist:6533166
export PS1="\e[0;32m\u (at) \h\e[m in \e[0;33m[\w]\e[m \n$ "
mhaligowski /
Last active Dec 15, 2015
MDS songs count by years

Million Songs Dataset is probably one of the most popular datasets for those who want to start fiddle with Big Data analysis and Hadoop. In a nutshell, it's a set of million songs, described by a long set of characteristics, like year of publishing, where the artist comes from, but also shape of the wave, segments, etc.

In order for a time analysis (like, how does the tempo change throughout the years), it is good to know what is the distribution of the data among the time. And this is what the chart above is about - I just how many songs for each year are there in the dataset.

The analysis was performed on 10 small instances on Amazon Map Reduce, and it took nearly 10 hours, which means that the cost of the analysis was 10 instances * 10 hours * (0.015 + 0.06)$ = 7.50$. Pretty cheap, isn't it?

More to come!

#!/usr/bin/env python
#-*- coding: utf-8 -*-
from optparse import OptionParser
import os
import requests
DEFAULT_API_PREFIX = '/webhdfs/v1/'
if __name__ == "__main__":
mhaligowski / gist:3852661
Created Oct 8, 2012
Add Maven dependencies to Arquillian
View gist:3852661
public static Archive<?> createDeployment() {
MavenDependencyResolver resolver = DependencyResolvers
return ShrinkWrap
.create(WebArchive.class, "drools-test.war")
mhaligowski / schema.sql
Created Sep 28, 2012
[Technogaraż] Kurs SQL, część I
View schema.sql
-- schemat bazy danych
create table products (
id number(10) primary key,
name varchar2(255),
price number(10),
vat number(2)
mhaligowski /
Created Sep 4, 2012
Recreate the subdirectories structure
(cd new/dir; find . -type d ! -name !.) | xargs mkdir