Skip to content

Commit aed1661

Browse files
committed
major changes
1 parent 10fb45a commit aed1661

18 files changed

+301
-77
lines changed

_layouts/default.html

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,60 @@
11
<!DOCTYPE html>
22
<html>
3-
<head>
4-
<meta charset="utf-8" />
5-
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
6-
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>
7-
8-
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.name }} – {{ site.description }}</title>
9-
10-
<meta name="author" content="{{ site.name }}" />
11-
<meta name="description" content="{{ site.description }}">
12-
13-
<!--[if lt IE 9]>
14-
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
15-
<![endif]-->
16-
17-
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/style.css" />
18-
<link rel="alternate" type="application/rss+xml" title="{{ site.name }} - {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />
19-
20-
<!-- Created with Jekyll Now - http://github.com/barryclark/jekyll-now -->
21-
</head>
22-
23-
<body>
24-
<div class="wrapper-masthead">
25-
<div class="container">
26-
<header class="masthead clearfix">
27-
<a href="{{ site.baseurl }}/" class="site-avatar"><img src="{{ site.avatar }}" /></a>
28-
29-
<div class="site-info">
30-
<h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
31-
<p class="site-description">{{ site.description }}</p>
32-
</div>
33-
34-
<nav>
35-
<a href="{{ site.baseurl }}/apps">Apps</a>
36-
<a href="{{ site.baseurl }}/">Blog</a>
37-
<a href="{{ site.baseurl }}/about">About</a>
38-
</nav>
39-
</header>
40-
</div>
41-
</div>
42-
43-
<div id="main" role="main" class="container">
44-
{{ content }}
45-
</div>
46-
47-
<div class="wrapper-footer">
48-
<div class="container">
49-
<footer class="footer">
50-
{% include svg-icons.html %}
51-
</footer>
52-
</div>
53-
</div>
54-
55-
{% include analytics.html %}
56-
</body>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
6+
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>
7+
8+
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.name }} – {{ site.description }}</title>
9+
10+
<meta name="author" content="{{ site.name }}" />
11+
<meta name="description" content="{{ site.description }}">
12+
13+
<!--[if lt IE 9]>
14+
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
15+
<![endif]-->
16+
17+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/style.css" />
18+
<link rel="alternate" type="application/rss+xml" title="{{ site.name }} - {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />
19+
20+
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
21+
</head>
22+
23+
<body>
24+
<div class="wrapper-masthead">
25+
<div class="container">
26+
<header class="masthead clearfix">
27+
<a href="{{ site.baseurl }}/" class="site-avatar"><img src="{{ site.avatar }}" /></a>
28+
29+
<div class="site-info">
30+
<h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
31+
<p class="site-description">{{ site.description }}</p>
32+
</div>
33+
34+
<nav>
35+
<a href="{{ site.baseurl }}/apps">Apps</a>
36+
<a href="{{ site.baseurl }}/">Blog</a>
37+
<a href="{{ site.baseurl }}/about">About</a>
38+
<!-- <a href="{{ site.baseurl }}/apps"><i class="fa fa-code"></i> Apps</a>
39+
<a href="{{ site.baseurl }}/"><i class="fa fa-file-text-o"></i> Blog</a>
40+
<a href="{{ site.baseurl }}/about"><i class="fa fa-smile-o"></i> About</a>-->
41+
</nav>
42+
</header>
43+
</div>
44+
</div>
45+
46+
<div id="main" role="main" class="container">
47+
{{ content }}
48+
</div>
49+
50+
<div class="wrapper-footer">
51+
<div class="container">
52+
<footer class="footer">
53+
{% include svg-icons.html %}
54+
</footer>
55+
</div>
56+
</div>
57+
58+
{% include analytics.html %}
59+
</body>
5760
</html>

_layouts/fullwidth.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: default
3+
---
4+
5+
<article class="page">
6+
7+
<h1>{{ page.title }}</h1>
8+
9+
<div class="entry">
10+
{{ content }}
11+
</div>
12+
</article>

_layouts/page.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,17 @@ <h1>{{ page.title }}</h1>
1010
{{ content }}
1111
</div>
1212
</article>
13+
<aside class="sidebar">
14+
<h2>Recent Posts</h2>
15+
<ul>
16+
{% for post in site.posts %}
17+
<li>
18+
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
19+
</li>
20+
{% endfor %}
21+
</ul>
22+
23+
<h2>Twitter feed</h2>
24+
<a class="twitter-timeline" href="https://twitter.com/s_bogdanovic" data-widget-id="547205779875315713">Tweets by @s_bogdanovic</a>
25+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
26+
</aside>

_posts/2014-12-14-Wordiction.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: post
33
title: Wordiction - text prediction app
4+
thumbnailurl: /images/wordiction_th.png
5+
published: true
46
---
57

68
Wordiction is a text prediction app that predicts the next word to be typed in, based on previous text. It is developed in the scope of the Capstone Project for Coursera / John Hopkins Data Science Specialization.

_posts/2014-12-22-data_science_specialization.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: post
33
title: Coursera Data Science Specialization
4+
thumbnailurl: /images/certificate_th.png
45
published: true
56
---
67

_posts/2014-6-19-worldcup2014.md

Lines changed: 138 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
22
layout: post
33
title: World Cup 2014 - soccer team and player stats
4+
thumbnailurl: /images/worldcup_th.png
5+
published: true
6+
highlight:
47
---
58

6-
[World Cup 2014](/apps/worldcup2014/) is a Shiny app that presents in tabular format detailed team and player stats during World Cup 2014, obtained from fifa.com website.
9+
[World Cup 2014](/apps/worldcup2014/) is an R application developed on [Shiny server](http://www.shinyapps.io). It presents in tabular format detailed team and player stats during World Cup 2014, obtained from fifa.com website.
710

811
The app highlights detailed metrics at team and player level in the following categories:
912

@@ -21,3 +24,137 @@ Initially, the app loads scoring related data for all participating teams.
2124
It is possible to view data related to specific team, by simply selecting a team in the dropdown. It is also possible to monitor other metrics by selecting the desired one in the Metric dropdown.
2225

2326
The data table is reactive and refreshes automatically.
27+
28+
{% highlight R linenos %}
29+
30+
31+
library(shiny)
32+
library(XML)
33+
scrape2014 <- function(url) {
34+
doc <- htmlParse(url)
35+
temp<-getNodeSet(doc, "/*//span[@class=\"sorted-icon-wrap\"]")
36+
removeNodes(temp)
37+
38+
var_names <- sapply(getNodeSet(doc, "//th"),
39+
xmlGetAttr, "class")
40+
var_names <- gsub(" playername-nolink", "", gsub("tbl-", "", var_names))
41+
tables <- readHTMLTable(doc)
42+
tab <- tables[[1]]
43+
44+
var_teams <- sapply(getNodeSet(doc, "//td/span/img[@class='flag']"),
45+
xmlGetAttr, "src")
46+
tab$flag = paste("<img src=\"",var_teams,"\" />")
47+
tab$team = toupper(gsub(".png", "", gsub("http://img.fifa.com/images/flags/3/", "", var_teams)))
48+
colnames(tab) <- c(var_names, "flag", "team")
49+
tab <- tab[c("flag", "team", var_names)]
50+
return(tab)
51+
}
52+
53+
bind2014 <- function(p) {
54+
url <- switch(
55+
p,
56+
'gs' = "http://www.fifa.com/worldcup/statistics/players/goal-scored.html",
57+
's' = "http://www.fifa.com/worldcup/statistics/players/shots.html",
58+
'sp' = "http://www.fifa.com/worldcup/statistics/players/shots-positions.html",
59+
'a' = "http://www.fifa.com/worldcup/statistics/players/attacking.html",
60+
'de' = "http://www.fifa.com/worldcup/statistics/players/defending.html",
61+
'di' = "http://www.fifa.com/worldcup/statistics/players/disciplinary.html",
62+
'p' = "http://www.fifa.com/worldcup/statistics/players/passes.html",
63+
'dis' = "http://www.fifa.com/worldcup/statistics/players/distance.html"
64+
)
65+
66+
try <- scrape2014(url)
67+
for (i in 4:ncol(try)) { try[,i] <- as.numeric(as.character(try[,i]))}
68+
nms <- switch(
69+
p,
70+
'gs' = c("F", "TEAM", "PLAYER", "MATCHES PLAYED", "MINUTES PLAYED",
71+
"TOTAL GOALS SCORED", "ASSISTS", "PENALTIES SCORED",
72+
"GOALS SCORED WITH THE LEFT FOOT", "GOALS SCORED WITH THE RIGHT FOOT",
73+
"HEADED GOALS"),
74+
's' = c("F", "TEAM", "PLAYER", "MATCHES PLAYED", "MINUTES PLAYED",
75+
"SHOTS", "ATTEMPTS ON TARGET", "ATTEMPTS OFF-TARGET", "WOODWORK"),
76+
'sp' = c("F", "TEAM", "PLAYER", "MATCHES PLAYED", "MINUTES PLAYED",
77+
"ATTEMPTS", "ATTEMPTS ON TARGET", "ATTEMPTS IN THE AREA",
78+
"ATTEMPTS OUTSIDE THE AREA", "ATTEMPTS ON-TARGET FROM INSIDE THE AREA",
79+
"ATTEMPTS ON-TARGET FROM OUTSIDE THE AREA"),
80+
'a' = c("F", "TEAM", "PLAYER", "MATCHES PLAYED", "MINUTES PLAYED",
81+
"TOTAL GOALS SCORED", "OFFSIDES", "SOLO RUNS INTO AREA",
82+
"LOST BALLS", "DELIVERIES IN PENALTY AREA", "TACKLES",
83+
"TACKLES SUFFERED"),
84+
'de' = c("F", "TEAM", "PLAYER", "MATCHES PLAYED", "MINUTES PLAYED",
85+
"TACKLES", "TACKLES WON", "ATTEMPTED CLEARANCES", "CLEARANCE RATE",
86+
"SAVES", "BLOCKS", "RECOVERED BALLS"),
87+
'di' = c("F", "TEAM", "PLAYER", "MATCHES PLAYED", "YELLOW CARDS",
88+
"SECOND YELLOW CARD AND RED CARD", "RED CARDS", "FOULS COMMITTED",
89+
"FOULS SUFFERED", "FOULS CAUSING A PENALTY"),
90+
'p' = c("F", "TEAM", "PLAYER", "MATCHES PLAYED", "MINUTES PLAYED",
91+
"TOTAL PASSES", "PASSES COMPLETED", "PASSES COMPLETED (%)",
92+
"CROSSES", "CROSSES COMPLETED", "CROSSES COMPLETED (%)", "CORNERS",
93+
"THROW-INS", "THROW-INS COMPLETED"),
94+
'dis' = c("F", "TEAM", "PLAYER", "MATCHES PLAYED", "MINUTES PLAYED",
95+
"DISTANCE COVERED", "DISTANCE COVERED IN POSSESSION",
96+
"DISTANCE COVERED NOT IN POSSESSION", "TOP SPEED")
97+
)
98+
names(try) <- nms
99+
return(try)
100+
}
101+
102+
shinyServer(function(input, output) {
103+
104+
plrs <- reactive({
105+
players <- bind2014(input$metric)
106+
if (input$team != "*") {
107+
players <- subset(players, TEAM == input$team)
108+
}
109+
return(players)
110+
})
111+
112+
tms <- reactive({
113+
t <- plrs()
114+
t[3] <- NULL
115+
t[,2] <- paste(t[,1], t[,2], sep="&nbsp;")
116+
t[1] <- NULL
117+
return(aggregate(. ~ TEAM, data = t, FUN = sum))
118+
})
119+
120+
url <- reactive({
121+
switch (input$metric,
122+
'gs' = "http://www.fifa.com/worldcup/statistics/players/goal-scored.html",
123+
's' = "http://www.fifa.com/worldcup/statistics/players/shots.html",
124+
'sp' = "http://www.fifa.com/worldcup/statistics/players/shots-positions.html",
125+
'a' = "http://www.fifa.com/worldcup/statistics/players/attacking.html",
126+
'de' = "http://www.fifa.com/worldcup/statistics/players/defending.html",
127+
'di' = "http://www.fifa.com/worldcup/statistics/players/disciplinary.html",
128+
'p' = "http://www.fifa.com/worldcup/statistics/players/passes.html",
129+
'dis' = "http://www.fifa.com/worldcup/statistics/players/distance.html"
130+
)
131+
})
132+
133+
output$topScorers <- renderDataTable({
134+
plrs()
135+
})
136+
137+
output$teamStats <- renderDataTable({
138+
tms()
139+
})
140+
141+
output$selMetric <- renderText({
142+
switch (input$metric,
143+
'gs' = "Goals Scored",
144+
's' = "Shots",
145+
'sp' = "Shots positions",
146+
'a' = "Attacking",
147+
'de' = "Defending",
148+
'di' = "Disciplinary",
149+
'p' = "Passes",
150+
'dis' = "Distance"
151+
)
152+
})
153+
154+
output$selUrl <- renderText({
155+
url()
156+
})
157+
158+
})
159+
160+
{% endhighlight %}

_scss/_variables.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
//
55

66
// Colors
7-
$blue: #4183C4;
7+
$blue: #115eb3;
8+
9+
$ruby: #c1272d;
810

911
// Grays
1012
$black: #000;

about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: About
44
permalink: /about/
55
---
66

7-
Chief Data Analyst and Data Scientist at Ruby Industries Inc.
7+
Chief Data Analyst and Data Scientist at [Ruby Industries Inc.](http://www.rubyind.com/)
88

99
### More Information
1010

11-
For the last 5 years I've been working in the iGaming industry with some of the major brands, helping iGaming their affiliate programs increase their revenues. I developed a number of data products and data integration solutions to help businesses gain actionable insights.
11+
For the last 6 years I've been working in the iGaming industry with some of the major brands, helping iGaming businesses and their affiliate programs increase their revenues. I developed a number of data products and data integration solutions to help them gain actionable insights.
1212

1313
### Contact me
1414

apps.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,47 @@ title: Apps
44
permalink: /apps/
55
---
66

7-
### [Bubble waltz](/apps/bubblewaltz/)
7+
These are some of the data products I developed recently. They're all open-sourced, and available on [GitHub](https://github.com/sasha-ruby).
88

9-
**Longevity in Canadian Provinces by Health Expenditure" motion chart** - It makes use of [Canadian Government Open Data](http://data.gc.ca/eng),
9+
<article class="">
10+
11+
<h2><a href="/apps/bubblewaltz/">Bubble Waltz</a></h2>
12+
13+
<div class="entry">
14+
<img src="/images/bubblewaltz_th.png" style="float: left; margin: 0 40px 20px 0;" />
15+
**Longevity in Canadian Provinces by Health Expenditure" motion chart** - It makes use of [Canadian Government Open Data](http://data.gc.ca/eng),
1016
combining data from the several data tables to correlate life expectancy, health expenditure and population by Canadian Province.
1117

12-
***
18+
</div>
19+
20+
<a href="/apps/bubblewaltz/" class="read-more">See it in action</a>
21+
</article>
1322

14-
### [Wordiciton](/apps/wordiction/)
23+
<article class="">
24+
25+
<h2><a href="/apps/wordiction/">Wordiciton</a></h2>
1526

16-
**Text typing word prediction** - Wordiction is a text prediction app that predicts the next word to be typed in,
27+
<div class="entry">
28+
<img src="/images/wordiction_th.png" style="float: left; margin: 0 40px 20px 0;" />
29+
**Text typing word prediction** - Wordiction is a text prediction app that predicts the next word to be typed in,
1730
based on previous text. It is developed in the scope of the Capstone Project for Coursera / John Hopkins Data Science Specialization.
1831

19-
***
32+
</div>
33+
34+
<a href="/apps/wordiction/" class="read-more">See it in action</a>
35+
</article>
36+
37+
<article class="">
38+
39+
<h2><a href="/apps/worldcup2014/">World Cup 2014 Stats</a></h2>
40+
41+
<div class="entry">
42+
<img src="/images/worldcup_th.png" style="float: left; margin: 0 40px 20px 0;" />
43+
**World Cup 2014 Team and player stats** - tabular representation of team and player statistics obtained from fifa.com website.
2044

21-
### [World Cup 2014 Stats](/apps/worldcup2014/)
45+
</div>
46+
47+
<a href="/apps/worldcup2014/" class="read-more">See it in action</a>
48+
</article>
2249

23-
**World Cup 2014 Team and player stats** - tabular representation of team and player statistics obtained from fifa.com website.
2450

25-
***

0 commit comments

Comments
 (0)