Skip to content

Instantly share code, notes, and snippets.

View Dev1an's full-sized avatar

Damiaan Dufaux Dev1an

View GitHub Profile
<div id="enter-page-box" style="background: rgba(250, 237, 216, 1); font-family: 'Alegreya Sans';text-align: center; cursor: pointer; width: 45em; padding: 1em; border: 1.5em solid rgba(28, 95, 131, 1)">
<header style="font-family: 'Alegreya SC'; padding: 1em; color: #25639E">
<h2 style="font-size: 1.6em; font-weight: 400">Welcome to the new website of the</h2>
<h1 style="font-size: 1.9em; font-weight: 400">Leuven Catholic English Speaking Community!</h1>
</header>
<section style="font-size: 1.3em">
<p style="margin: 1em 0">Our website is <span style="font-family: Alegreya Sans SC; font-style: italic;">brand new!</span> We’re bringing you a new look, a new domain, and a new adventure.</p>
<p style="margin: 1em 0">You may encounter a few bumps during your visit. If something doesn’t display correctly, look right, etc., please send a message to the webmaster, and we’ll get it fixed.</p>
<p style="margin: 1em 0">Thanks for your feedback, support, and patience as we continue to improve your online ex
<div id="enter-page-box" style="background: rgba(250, 237, 216, 1); font-family: 'Alegreya Sans';text-align: center; cursor: pointer; width: 40em; padding: 1em; border: 1.5em solid rgba(28, 95, 131, 1)">
<header style="font-family: 'Alegreya SC'; padding: 1em; color: #25639E">
<h2 style="font-size: 2em; font-weight: 200">Welcome to the new website of the</h2>
<h1 style="font-size: 2em; font-weight: bold">Leuven Catholic English Speaking Community!</h1>
</header>
<section style="font-size: 1.3em">
<p style="margin: 1em 0">Our website is brand new! We’re bringing you a new look, a new domain, and a new adventure.</p>
<p style="margin: 1em 0">You may encounter a few bumps during your visit. If something doesn’t display correctly, look right, etc., please send a message to the webmaster, and we’ll get it fixed.</p>
<p style="margin: 1em 0">Thanks for your feedback, support, and patience as we continue to improve your online experience with our community!</p>
</section>
//: Playground - noun: a place where people can play
import Foundation
protocol MyProtocol {
var count: UInt {get}
mutating func increment()
}
struct MyStruct<T: MyProtocol>: MyGenericStructProtocol {
@Dev1an
Dev1an / XALG-Converting.md
Last active September 3, 2017 17:46
xalg files converteren
  • Optie 1: Final Cut Pro X downloaden en daarmee de video openen. (📞 naar Michel voor licentie 💵)

  • Optie 2: Doen wat Thomas zegt: ffmpeg installeren en zijn script uitvoeren:

    • De volgende stappen loodsen je door het uitvoeren van scripts in de terminal. De grijs omkaderde tekststukken moeten geplakt worden in de terminal en bevatten geen “enter” tekens. Dus als je browser deze (omkaderde) tekst opgesplitst heeft in verschillende regels (gescheiden door “enter” tekens) dan doe je die (enter tekens) best eerst weg voor je ze in de terminal plakt.

    • Om ffmpeg te installeren heb je eerst HomeBrew nodig.

    • Homebrew installeren:

const Zyre = require('zyre.js')
const zreObserver = new Zyre()
zreObserver.start(function() {
console.log('connected')
zreObserver.join('visualisation')
})
zreObserver.on('join', (peerId, name, group) => {
@Dev1an
Dev1an / WAMP-URI-coding.js
Last active July 14, 2017 18:26
Decode/Encode WAMP URI's
function encode(string) {
return string.replace(/[\x20\x23\x25\x2e]/g, (character, offset) => "%" + string.charCodeAt(offset).toString(16))
}
function decode(string) {
return string.replace(/%(20|23|25|2e|2E)/g, (character, hex) => String.fromCharCode(parseInt(hex, 16)))
}
@Dev1an
Dev1an / Predicates.swift
Last active June 8, 2017 15:32
Generic predicates (in Swift 4)
extension Sequence {
func find<Property, Argument>(where predicate: (propertyPath: KeyPath<Self.Element, Property>, comparator: (Property, Argument)->Bool, argument: Argument)) -> [Self.Element] {
return filter { predicate.comparator($0[keyPath: predicate.propertyPath], predicate.argument) }
}
// A more specialised version:
func find(where characteristic: KeyPath<Self.Element, Bool>) -> [Self.Element] {
return filter { $0[keyPath: characteristic] }
}
}
function highlight(highlightedElement) {
var restore = []
const oldRadius = highlightedElement.style.borderRadius
const oldShadow = highlightedElement.style.boxShadow
restore.push(() => {highlightedElement.style.borderRadius = oldRadius; highlightedElement.style.boxShadow = oldShadow})
highlightedElement.style.borderRadius = "1px"
highlightedElement.style.boxShadow = "0 0 0 4px white , 2px 2px 10px 4px rgba(0, 0, 0, 0.39)"
const timer = setTimeout(function() {
@Dev1an
Dev1an / SortedArray.swift
Last active November 5, 2016 12:21
A sorted array in swift
//
// SortedArray.swift
//
// Created by Damiaan on 05-11-16.
// Copyright © 2016 Damiaan. All rights reserved.
//
import Foundation
public struct SortedArray<Element>: RandomAccessCollection, Collection {
@Dev1an
Dev1an / csv.swift
Created November 3, 2016 17:43
import CSV in swift
public protocol CommaSeparatedValueCompatible {
init(values: [String]) throws
}
public func arrayFromCSV<Record: CommaSeparatedValueCompatible>(at file: URL, lineSeparator: String = "\n", columnSeparator: String = ",") throws -> [Record] {
let lines = try String(contentsOf: file).trimmingCharacters(in: CharacterSet(charactersIn: lineSeparator)).components(separatedBy: lineSeparator)
return try lines.dropFirst().map { line in
return try Record(values: line.components(separatedBy: columnSeparator))
}
}