Skip to content

Instantly share code, notes, and snippets.

View mhaligowski's full-sized avatar
🎯
Focusing

Mateusz Haligowski mhaligowski

🎯
Focusing
  • gradient.ai
  • Seattle, WA
  • 14:17 (UTC -08:00)
View GitHub Profile
@mhaligowski
mhaligowski / recreate_structure.sh
Created September 4, 2012 11:51
Recreate the subdirectories structure
#!/bin/bash
(cd new/dir; find . -type d ! -name !.) | xargs mkdir
@mhaligowski
mhaligowski / schema.sql
Created September 28, 2012 09:04
[Technogaraż] Kurs SQL, część I
-- 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 October 8, 2012 13:55
Add Maven dependencies to Arquillian
@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())
@mhaligowski
mhaligowski / copy_from_local.py
Last active December 10, 2015 01:29
MapReduce Example
#!/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 December 15, 2015 12:59
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!

@mhaligowski
mhaligowski / gist:6533166
Created September 12, 2013 04:47
My ultra-cool terminal PS
export PS1="\e[0;32m\u (at) \h\e[m in \e[0;33m[\w]\e[m \n$ "
@mhaligowski
mhaligowski / dsl.js
Created October 9, 2013 15:49
Extending angular-scenario for using jQuery in tests
'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 November 18, 2013 15:19
The worst piece of code ever seen
// 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 / all.json
Last active October 3, 2017 20:45
Poland GeoJSON
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhaligowski
mhaligowski / index.html
Last active December 28, 2015 19:59
Poland unemployment rate September 2013
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.counties {
fill: none;
}
.states {
fill: none;