Merge remote-tracking branch 'origin/master' into wemadeitboyz

This commit is contained in:
Lorin Werthen 2016-10-03 22:42:50 +02:00
commit f3ff3cdb8d
34 changed files with 210 additions and 233 deletions

View file

@ -19,4 +19,4 @@ script:
after_success: after_success:
- mv deploy_key ~/.ssh/id_rsa - mv deploy_key ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa
- '[[ $TRAVIS_BRANCH == "master" ]] && bundle exec nanoc deploy --target public' - '[[ $TRAVIS_BRANCH == "master" ]] && bundle exec nanoc deploy public'

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'nanoc', '~>4.3.1' gem 'nanoc', '~>4.3.3'
gem 'kramdown' gem 'kramdown'
gem 'coffee-script' gem 'coffee-script'
# Needed for relativize_urls # Needed for relativize_urls

View file

@ -3,7 +3,7 @@ GEM
specs: specs:
adsf (1.2.1) adsf (1.2.1)
rack (>= 1.0.0) rack (>= 1.0.0)
autoprefixer-rails (6.4.0.3) autoprefixer-rails (6.5.0.1)
execjs execjs
builder (3.2.2) builder (3.2.2)
coderay (1.1.1) coderay (1.1.1)
@ -35,7 +35,7 @@ GEM
hamster (3.0.0) hamster (3.0.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
highline (1.7.8) highline (1.7.8)
icalendar (2.4.0) icalendar (2.4.1)
json (2.0.2) json (2.0.2)
kramdown (1.12.0) kramdown (1.12.0)
listen (3.1.5) listen (3.1.5)
@ -45,7 +45,7 @@ GEM
lumberjack (1.0.10) lumberjack (1.0.10)
method_source (0.8.2) method_source (0.8.2)
mini_portile2 (2.1.0) mini_portile2 (2.1.0)
nanoc (4.3.2) nanoc (4.3.4)
cri (~> 2.3) cri (~> 2.3)
hamster (~> 3.0) hamster (~> 3.0)
ref (~> 2.0) ref (~> 2.0)
@ -87,10 +87,10 @@ DEPENDENCIES
highline highline
icalendar icalendar
kramdown kramdown
nanoc (~> 4.3.1) nanoc (~> 4.3.3)
nokogiri nokogiri
sass sass
w3c_validators w3c_validators
BUNDLED WITH BUNDLED WITH
1.12.5 1.13.0

21
Rules
View file

@ -4,6 +4,9 @@
require 'json' require 'json'
require 'icalendar' require 'icalendar'
# Please @NoctuaNivalis
require 'socket'
# #
# #
# PREPROCESS # PREPROCESS
@ -28,11 +31,20 @@ preprocess do
academic_years.each do |year| academic_years.each do |year|
@items.create( @items.create(
'', '',
{ academic_year: year }, { academic_year: year, title: "Blog" },
"/archives/#{year}-#{year + 1}.html", "/blog/#{year}-#{year + 1}.html",
binary: false binary: false
) )
end end
academic_years_items[academic_years.max].update_attributes(
navigable: true,
order: 10
)
all_events.each do |event|
event[:time] = Date.parse(event[:time])
end
end end
# #
@ -45,10 +57,12 @@ compile '/feed.xml' do
write '/feed.xml' write '/feed.xml'
end end
passthrough '/quotes.json'
# #
# ARCHIVES # ARCHIVES
# #
compile '/archives/*' do compile '/blog/*' do
layout '/archive_page.*' layout '/archive_page.*'
layout '/generic.*' layout '/generic.*'
layout '/default.*' layout '/default.*'
@ -139,6 +153,7 @@ ignore '/assets/stylesheets/includes/**/*'
compile '/assets/stylesheets/**/*.scss' do compile '/assets/stylesheets/**/*.scss' do
filter :sass, syntax: :scss filter :sass, syntax: :scss
filter :autoprefixer if Socket.gethostname == 'abysm'
end end
passthrough '/assets/images/*.{png,svg}' passthrough '/assets/images/*.{png,svg}'

View file

@ -1,6 +1,7 @@
--- ---
navigable: true navigable: true
title: About title: About
order: 0
--- ---
<div class="content"> <div class="content">
<h1>Over Zeus WPI</h1> <h1>Over Zeus WPI</h1>

View file

@ -1,11 +0,0 @@
---
navigable: true
title: Archieven
---
<ul class = "archive_list">
<% academic_years_items.each do |year, item| %>
<li>
<%= link_to pretty_year(year), item %>
</li>
<% end %>
</ul>

View file

@ -25,7 +25,7 @@ $ "#cammie-ctrls"
$ '.ctrl' $ '.ctrl'
.click -> .click ->
$context = $ this $context = $ this
$.ajax "//kelder.zeus.ugent.be/webcam/cgi/ptdc.cgi", $.ajax "https://kelder.zeus.ugent.be/webcam/cgi/ptdc.cgi",
data: data:
command: $context.data 'command' command: $context.data 'command'
posX: $context.data 'x' posX: $context.data 'x'

View file

@ -0,0 +1,8 @@
$ ->
$.getJSON 'https://zeus.ugent.be/game/top4/show.json', (data) ->
str = "<ol>"
for x in data
str += "<li><a href=\"#{x.github_url}\">#{x.github_name}</a> (#{x.score} Z$)</li>"
str += "</ol>"
$('#gamification-coders').html(str)

View file

@ -0,0 +1,4 @@
$ ->
$.getJSON 'http://localhost:3000/quotes.json', (data) ->
quote = data[Math.floor(Math.random()*data.length)]
$('#quote').append("<h3>#{quote.title}</h3><p>#{quote.description}</p>")

View file

@ -3,3 +3,14 @@
font-size: 4em; font-size: 4em;
} }
} }
.padbox{
margin-bottom:10px;
}
.bolder a{
color:#565C5E;
font-weight: bold;
font-size: 20pt;
font-family: 'Avenir';
}

View file

@ -48,3 +48,8 @@ footer.footer {
vertical-align: inherit; vertical-align: inherit;
} }
} }
::selection {
color: white;
background: rgba(255, 127, 0, 0.99);
}

View file

@ -1,25 +0,0 @@
/*# sourceMappingURL=projects.css.map */
/* line 4, /Users/mehmet/Projects/zeus.ugent.be/content/assets/stylesheets/includes/projects.scss */
.imgspace {
display: flex;
justify-content: space-around;
width: 100%;
text-align: center; }
/* line 11, /Users/mehmet/Projects/zeus.ugent.be/content/assets/stylesheets/includes/projects.scss */
.imgcenter {
display: flex;
justify-content: center;
/* align horizontal */
align-items: center;
/* align vertical */ }
/* line 18, /Users/mehmet/Projects/zeus.ugent.be/content/assets/stylesheets/includes/projects.scss */
.padbot {
padding-bottom: 15px; }
/* line 24, /Users/mehmet/Projects/zeus.ugent.be/content/assets/stylesheets/includes/projects.scss */
.padtop {
padding-top: 25px; }
/*# sourceMappingURL=projects.css.map */

View file

@ -1,20 +1,16 @@
a.box { a.box {
color: #000; &:hover {
box-shadow: 0 2px 3px rgba($black, 0.1), 0 0 0 1px $blue
}
} }
#homepage { #homepage {
.box { .box {
background-color: $box-colour; border-radius: 0;
&.highlighted {
background-color: $highlighted-box-colour;
color: $highlighted-text-colour;
.content {
h1 {
color: white;
}
}
}
} }
} }
.centering {
display: flex;
justify-content: center;
}

View file

@ -1,14 +1,19 @@
// Colours // Colours
$zeus-orange: #FF7F00; $zeus-orange: #FF7F00;
$zeus-blue: #00C4FF;
$navbar-border-color: #CCC; $navbar-border-color: #CCC;
$event-border-color: #DDD; $event-border-color: #DDD;
$orange: $zeus-orange; $orange: $zeus-orange;
$blue: $zeus-blue;
$primary: $orange; $primary: $orange;
$family-sans-serif: 'Lato', sans-serif; $family-sans-serif: 'Lato', sans-serif;
$link-visited: inherit; $link-visited: inherit;
$border_hover: $blue;
$box-colour: #EEE; $box-colour: #EEE;
$highlighted-box-colour: $zeus-orange; $highlighted-box-colour: $zeus-orange;
$highlighted-text-colour: white; $highlighted-text-colour: white;

View file

@ -1,6 +1,7 @@
--- ---
navigable: true navigable: true
title: Events title: Events
order: 20
--- ---
<div> <div>
@ -8,7 +9,22 @@ title: Events
<h1>Upcoming events</h1> <h1>Upcoming events</h1>
</div> </div>
<% all_events.each do |event| %> <% upcoming_events.each do |event| %>
<!-- <hr class="divider"> -->
<% if (sub_events(event)).empty? %>
<%= render '/partials/_event_preview.*', event: event %>
<% else %>
<% sub_events(event).each do |sub_event| %>
<%= render '/partials/_event_preview.*', event: sub_event, main_event: event %>
<% end %>
<% end %>
<% end %>
<div class="content">
<h1>Past events</h1>
</div>
<% past_events.each do |event| %>
<!-- <hr class="divider"> --> <!-- <hr class="divider"> -->
<% if (sub_events(event)).empty? %> <% if (sub_events(event)).empty? %>
<%= render '/partials/_event_preview.*', event: event %> <%= render '/partials/_event_preview.*', event: event %>

View file

@ -1,16 +0,0 @@
---
title: AWK-les
banner: https://zeus.ugent.be/wp-content/uploads/2016/02/awkles-768x1007.jpg
description: Een AWK-les voor AWK gerelateerde dingen
created_at: 01-02-2016
time: 23-02-2016
location: Auditorium A1, Campus Sterre, Gebouw S9
locationlink: Zeus WPI,Ghent Belgium
description: Dit is een description van het awk event!
---
Op **dinsdag 23 februari 18:00** (na de les Scriptingtalen) in **Auditorium A1** organiseren we een **AWK-les** gegeven door **professor Peter Dawyndt**.
**AWK** is een scriptingtaal, bedoeld om lijn per lijn tekstbestanden te verwerken. Zo wordt AWK vaak gebruikt voor de ingebouwde werking met delimiters om CSV bestanden en dergelijke te verwerken. AWK staat tevens bekend om de talloze [one-liners](http://www.pement.org/awk/awk1line.txt) die in de command line gebruikt kunnen worden.
Sinds vorig jaar wordt AWK (samen met sed) niet meer gegeven in het vak Scriptingtalen, om meer te kunnen concentreren op Python en JavaScript. Hoewel deze zeer goede general purpose talen zijn, blijft AWK ongeëvenaard voor razendsnelle tekstverwerking en transformaties.

View file

@ -1,6 +0,0 @@
---
title: Bottle Bats Introductie
time: 12-3-16
location: Grace Hopper
description: Dit is een description!
---

View file

@ -1,3 +0,0 @@
---
title: Bottle Bats
---

View file

@ -1,6 +0,0 @@
---
title: test
time: 12-3-16
location: Grace Hopper
description: Dit is een description!
---

View file

@ -3,7 +3,7 @@ title: Geeks, Attack! V
banner: https://scontent.xx.fbcdn.net/v/t1.0-9/13903431_1277596932251344_3927837466166230371_n.jpg?oh=bdda0d18a635c49893a097fba6aa99b9&oe=587C7886 banner: https://scontent.xx.fbcdn.net/v/t1.0-9/13903431_1277596932251344_3927837466166230371_n.jpg?oh=bdda0d18a635c49893a097fba6aa99b9&oe=587C7886
description: Zeus' vijfde LAN-Party description: Zeus' vijfde LAN-Party
created_at: 13-09-2016 created_at: 13-09-2016
time: 4-11-2016 time: 04-11-2016
location: Therminal, Hoveniersberg 24 9000 Gent location: Therminal, Hoveniersberg 24 9000 Gent
locationlink: Therminal,Ghent Belgium locationlink: Therminal,Ghent Belgium
description: Zeus' vijfde LAN-Party description: Zeus' vijfde LAN-Party

View file

@ -0,0 +1,14 @@
---
title: Bezoek datacenter
banner: https://emergingtechblog.emc.com/wp-content/uploads/2015/10/AdobeStock_86289688.jpeg
description: Zeus bezoekt het datacenter en de supercomputer in S10!
created_at: 3-10-2016
time: 10-10-2016
location: hpc gent
locationlink: 51.023650, 3.712018
---
Zeus WPI organiseert in samenwerking met de medewerkers van de HPC een rondleiding in de S10.
Hier bevindt zich het datacenter en sinds enkele jaren de supercomputer.
Een echte must-see voor elke informaticus.
Inschrijven is verplicht en kunt u [hier](https://event.fkgent.be/events/111) doen .

View file

@ -7,81 +7,73 @@
<div id="homepage"> <div id="homepage">
<div class="tile is-vertical is-ancestor"> <div class="tile is-vertical is-ancestor">
<div class="tile is-parent is-12"> <div class="tile is-parent is-12">
<%= render '/partials/_tile.*', article: all_events[0] %> <%= render '/partials/_tile.*', article: all_events[0], htmlclass: "highlighted", small_text: "Upcoming event" %>
</div> </div>
<div class="tile"> <div class="tile">
<div class="tile is-parent is-4"> <div class="tile is-parent is-4">
<%= render '/partials/_tile.*', article: all_events[1], htmlclass: "highlighted" %> <%= render '/partials/_tile.*', article: all_events[1], small_text: "Upcoming event" %>
</div> </div>
<div class="tile is-parent is-4"> <div class="tile is-parent is-4">
<div class="tile is-child box highlighted"> <div class="tile is-child box highlighted">
IDK LOL <!-- <img src="//thecatapi.com/api/images/get?format=src&type=gif&size=small"> -->
<div class="content has-text-centered">
<blockquote id="quote" >
<!-- INTENTIONALLY LEFT BLANK -->
</blockquote>
</div>
</div> </div>
</div> </div>
<div class="tile is-vertical is-2"> <div class="tile is-vertical is-2">
<a class="tile" href="https://zeus.ugent.be/wiki">
<div class="tile is-parent"> <div class="tile is-parent">
<div class="tile is-child box has-text-centered"> <div class="tile is-child box imgcenter" >
<%= fa 'wikipedia-w' %> <%= fa 'wikipedia-w' %>
</div> </div>
</div> </div>
</a>
<a class="tile" href="/cammie">
<div class="tile is-parent"> <div class="tile is-parent">
<div class="tile is-child box has-text-centered"> <div class="tile is-child box imgcenter">
<%= fa 'video-camera' %> <%= fa 'video-camera' %>
</div> </div>
</div> </div>
</a>
</div> </div>
<div class="tile is-vertical is-2"> <div class="tile is-vertical is-2">
<a class="tile" href="https://github.com/ZeusWPI">
<div class="tile is-parent"> <div class="tile is-parent">
<div class="tile is-child box has-text-centered"> <div class="tile is-child box imgcenter">
<%= fa 'github' %> <%= fa 'github' %>
</div> </div>
</div> </div>
</a>
<a class="tile" href="https://www.facebook.com/zeus.wpi/?fref=ts">
<div class="tile is-parent"> <div class="tile is-parent">
<div class="tile is-child box has-text-centered"> <div class="tile is-child box imgcenter">
<%= fa 'facebook-official' %> <%= fa 'facebook-official' %>
</div> </div>
</div> </div>
</a>
</div> </div>
</div> </div>
<div class="tile"> <div class="tile">
<div class="tile is-4 is-parent"> <div class="tile is-4 is-parent">
<div class="tile is-child box"> <%= render '/partials/_tile.*', article: sorted_articles.first, small_text: "Latest blogpost" %>
<div class="content">
<h1><%= sorted_articles.first[:title] %></h1>
<%= sorted_articles.first[:description] %>
</div>
</div>
</div> </div>
<div class="tile is-vertical"> <div class="tile is-vertical">
<div class="tile is-parent"> <div class="tile is-parent">
<div class="tile is-child box"> <div class="tile is-child box">
<p> <div class="content">
Numero uno: @werthen <h1><a href="https://zeus.ugent.be/game">Top Zeus WPI coders this week</a></h1>
</p> <div id="gamification-coders">
<p> <!-- EMPTY -->
Numero dos: @myncke
</p>
<p>
Numero tres: @iepoev
</p>
<p>
Numero quatro: @becousae
</p>
</div> </div>
</div> </div>
<div class="tile">
<div class="tile is-6 is-parent">
<div class="tile is-child box">
GITHUB
</div>
</div>
<div class="tile is-6 is-parent">
<div class="tile is-child box">
GITHUB
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<%= asset :js, :gamification %>
<%= asset :js, :quote %>

View file

@ -1,36 +0,0 @@
---
title: C review
description: We hebben even wat dingen in C geschreven, en dit zijn onze meningen
created_at: 23-10-2016
---
> *Ben ik nu echt de enige die C echt niet leuk vindt?*
>
> <small>&mdash; Ilion Iasoon Beyst</small>
C is een toffe taal enal
~~~
Individual *genetic_algo(Area *area, StationCol *stations, double lo, double hi) {
// Initialize global variables
init_coverage_polygon(area);
MAX_POWER = power_to_energy_usage(43);
Population* p = generate_initial_population(POPULATION_SIZE, stations);
recalculate_fitness(area, stations, p, lo, hi);
Individual* best = genetic_algo_exec(p, area, stations, POPULATION_SIZE, lo, hi, clock());
for (size_t i = 0; i < best->size; i++) {
printf("%d\n", best->distribution[i]);
}
printf("%f\n", calculate_energy_usage(stations, best));
printf("%f\n", calculate_station_coverage(area, stations, best, NULL));
for (size_t i = 0; i < p->size; i++) {
individual__free(p->elems[i]);
}
population__free(p);
return best;
}
~~~

View file

@ -1,6 +1,7 @@
--- ---
navigable: true navigable: true
title: Projecten title: Projecten
order: 30
--- ---
<div class="content"> <div class="content">
<div class="container"> <div class="container">

1
content/quotes.json Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
--- ---
navigable: true navigable: false
title: Search title: Search
--- ---
<form action="?" method="get"> <form action="?" method="get">

View file

@ -1,12 +1,9 @@
<% posts_in_year(item[:academic_year]).each do |post| %> <div class="columns" >
<a href="<%= relative_path_to(post) %>"> <div class="column">
<div class="box"> <% posts_in_year(item[:academic_year]).each do |post| %>
<a href="<%= relative_path_to(post) %>" >
<div class="box padbox">
<article class="media"> <article class="media">
<figure class="media-left">
<p class="image is-64x64">
<img src="<%= post[:banner] %>">
</p>
</figure>
<div class="media-content"> <div class="media-content">
<div class="content"> <div class="content">
<h2><%= post[:title] %></h2> <h2><%= post[:title] %></h2>
@ -15,5 +12,16 @@
</div> </div>
</article> </article>
</div> </div>
</a> </a>
<% end %> <% end %>
</div>
<div class="column is-narrow">
<ul class = "archive_list">
<% academic_years_items.each do |year, item| %>
<li class="bolder">
<%= link_to pretty_year(year), item %>
</li>
<% end %>
</ul>
</div>
</div>

View file

@ -5,15 +5,13 @@
<meta property="og:url" content="<%= url_for(item) %>" /> <meta property="og:url" content="<%= url_for(item) %>" />
<% end %> <% end %>
<section class="hero is-medium is-info is-bold"> <section class="hero is-medium is-primary is-bold">
<div class="hero-head"> <div class="hero-head">
<%= render '/partials/_navbar.*', zeus_logo_color: :white %> <%= render '/partials/_navbar.*', zeus_logo_color: :white %>
</div> </div>
<div class="hero-body "> <div class="hero-body">
<div class="container"> <div class="container">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<p class="title is-1"> <p class="title is-1">
<b> <b>
@ -25,16 +23,15 @@
</p> </p>
<p class="subtitle is-3"> <p class="subtitle is-3">
<ul class="fa-ul"> <ul class="fa-ul">
<li><%= fa 'clock-o', li: true %><%= item[:time] %></li> <li><%= fa 'clock-o', li: true %><%= item[:time].strftime '%A %d %B %Y' %></li>
<li><%= fa 'globe', li: true %><%= item[:location] %></li> <li><%= fa 'map-marker', li: true %><%= item[:location] %></li>
</ul> </ul>
</p> </p>
</div> </div>
<div class="is-narrow column banner-image"> <div class="is-narrow column banner-image">
<img src=<%= item[:banner] %> > <img src="<%= item[:banner] %>" >
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -43,7 +40,7 @@
<section class="section"> <section class="section">
<div class="columns"> <div class="columns">
<div class="column is-8 is-offset-2"> <div class="column is-8 is-offset-2">
<div class="content has-text-justified"> <div class="content has-text-justified is-medium">
<%= yield %> <%= yield %>
</div> </div>
</div> </div>

View file

@ -1,19 +1,17 @@
<a href="<%= relative_path_to(@article) %>" class="tile is-child box <%= @htmlclass %>"> <a href="<%= relative_path_to(@article) %>" class="tile is-child box <%= @htmlclass %>">
<div class="main-tile">
<div class="content"> <div class="content">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<h1> <h2>
<%= @article[:title] %> <%= @article[:title] %>
</h1> </h2>
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
<small> <small>
<%= @article[:created_at] %> <%= @small_text %>
</small> </small>
</div> </div>
</div> </div>
<%= @article[:description] %> <%= @article[:description] %>
</div> </div>
</div>
</a> </a>

View file

@ -11,7 +11,7 @@ module ArchiveHelper
end end
def academic_years_items def academic_years_items
academic_years.map { |y| [y, items["/archives/#{y}-#{y + 1}.html"]] }.to_h academic_years.to_a.reverse.map { |y| [y, items["/blog/#{y}-#{y + 1}.html"]] }.to_h
end end
def pretty_year(year) def pretty_year(year)

View file

@ -1,7 +1,15 @@
require 'uri' require 'uri'
module EventsHelper module EventsHelper
def all_events def all_events
@items.find_all('/events/*/*') + grouped_events @items.find_all('/events/*/*').sort_by { |x| x[:time] }
end
def upcoming_events
all_events.reject { |x| x[:time] < Date.today }
end
def past_events
all_events.reject { |x| x[:time] >= Date.today }
end end
def grouped_events def grouped_events

View file

@ -11,7 +11,7 @@ module IcalHelper
def event_for(item) def event_for(item)
event = Icalendar::Event.new event = Icalendar::Event.new
event.dtstart = Date.parse(item[:time]) event.dtstart = item[:time]
event.summary = 'A great event!' event.summary = 'A great event!'
event event

View file

@ -1,6 +1,6 @@
module NavigationHelper module NavigationHelper
def nav_items def nav_items
navigables = items.select { |i| i[:navigable] } navigables = items.select { |i| i[:navigable] }.sort_by { |x| x[:order] || 10000 }
navigables.each do |item| navigables.each do |item|
is_active = @item_rep && @item_rep.path == item.path is_active = @item_rep && @item_rep.path == item.path

View file

@ -7,6 +7,6 @@
"license": "MIT", "license": "MIT",
"repository": "https://github.com/ZeusWPI/zeus.ugent.be", "repository": "https://github.com/ZeusWPI/zeus.ugent.be",
"dependencies": { "dependencies": {
"bulma": "^0.1.2" "bulma": "^0.2.1"
} }
} }