Skip to content

Instantly share code, notes, and snippets.

Avatar

Mateusz Haligowski mhaligowski

View GitHub Profile
@mhaligowski
mhaligowski / Gemfile
Last active Aug 29, 2015
rakefile for asciidoctor
View Gemfile
source 'https://rubygems.org'
gem 'asciidoctor'
gem 'tilt'
gem 'haml'
gem 'rake'
@mhaligowski
mhaligowski / recreate_structure.sh
Created Sep 4, 2012
Recreate the subdirectories structure
View recreate_structure.sh
#!/bin/bash
(cd new/dir; find . -type d ! -name !.) | xargs mkdir
@mhaligowski
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
mhaligowski / gist:3852661
Created Oct 8, 2012
Add Maven dependencies to Arquillian
View gist:3852661
@Deployment
public static Archive<?> createDeployment() {
MavenDependencyResolver resolver = DependencyResolvers
.use(MavenDependencyResolver.class);
return ShrinkWrap
.create(WebArchive.class, "drools-test.war")
.addAsLibraries(
resolver.artifact("pl.proinvest:frontend-common:1.0")
.resolveAsFiles())
View copy_from_local.py
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from optparse import OptionParser
import os
import requests
DEFAULT_API_PREFIX = '/webhdfs/v1/'
if __name__ == "__main__":
@mhaligowski
mhaligowski / README.md
Last active Dec 15, 2015
MDS songs count by years
View README.md

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!

@mhaligowski
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
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
$.post('/admin/tasks/resetStorage');
return done();
});
};
@mhaligowski
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)}.
*/
@Deprecated
@Override
protected String getProperty(String propertyName) {
return super.getProperty(propertyName);
}
@mhaligowski
mhaligowski / index.html
Last active Dec 28, 2015
Poland unemployment rate September 2013
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.counties {
fill: none;
}
.states {
fill: none;