Skip to content

Instantly share code, notes, and snippets.

View s-leroux's full-sized avatar

Sylvain Leroux s-leroux

View GitHub Profile
@s-leroux
s-leroux / aboutus.html
Created October 26, 2015 20:36
Front-End Web UI Frameworks and Tools -- week 3 exercice 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head
content must come *after* these tags -->
<title>Ristorante Con Fusion: About Us</title>
@s-leroux
s-leroux / cloudera-lab-domain.xml
Created October 28, 2015 10:03
Cloudera Quickstart VM virsh domain configuration
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>cloudera-lab</name>
<uuid>a682109a-774b-11e5-b6a2-9b5b6cc0bf3b</uuid>
<memory>8388608</memory>
<vcpu>2</vcpu>
<os>
<type arch="x86_64">hvm</type>
</os>
<features>
@s-leroux
s-leroux / console.conf
Last active November 6, 2015 15:16
Fix for Ubuntu 14.04.3 LTS (Trusty) /etc/init/console.conf and /etc/default/grub in order to have both boot messages and a getty login spawn on /dev/ttyS0.
# console - getty
#
# This service maintains a getty on console from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345] and (
not-container or
container CONTAINER=lxc or
container CONTAINER=lxc-libvirt)
@s-leroux
s-leroux / roles.py
Last active November 6, 2015 15:32
Cloudera Cloud-Networking course fix for the `cloudnetmooc/minidc/roles.py` file required to allow X11 forwarding from mininet hosts to remote system connected using `ssh -X ...`
#!/usr/bin/env python
"""
HostRole: superclass for all roles (single instance of an application)
running on a host.
X11Role: superclass for X11 roles (single instance of an application
requiring X11 forwarding)
ChromeClient: starts a chrome instance on the host
@s-leroux
s-leroux / Lecture4.java
Last active November 24, 2015 22:43
Basic Swing application using lambda as event listener.
package loonycorn.swing;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Lecture4 {
@s-leroux
s-leroux / Lecture18a
Last active November 26, 2015 11:08
Loony Corn JavaFX course on Udemy -- experiments with properties on lecture 18
package loonycorn.javafx;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Lecture18a extends Application {
@s-leroux
s-leroux / gulpfile.js
Last active December 15, 2015 22:21
Cousera "Front-End JavaScript Frameworks: AngularJS" course -- gulpfile.js at the start of exercice "Angular Forms and Form Validation"
var gulp = require('gulp'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
uglify = require('gulp-uglify'),
usemin = require('gulp-usemin'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
@s-leroux
s-leroux / Gruntfile.js
Created December 21, 2015 10:02
Cousera "Front-End JavaScript Frameworks: AngularJS" course -- Gruntfile.js at the end of the course
'use strict';
module.exports = function (grunt) {
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Automatically load required Grunt tasks
require('jit-grunt')(grunt, {
useminPrepare: 'grunt-usemin'
});
@s-leroux
s-leroux / adjlist_search.py
Created December 27, 2015 23:33
Build random graphs to collect statistics about search in adjacency lists
#!/usr/bin/python3
from random import randint
from collections import defaultdict
for i in range(10, 10100, 100):
nEdges = 50
# Build i random pair of nodes
edges = set() # ensure uniqueness of each edge in the graph
while len(edges) < nEdges:
@s-leroux
s-leroux / OccupancyComparer.java
Created December 30, 2015 13:27
Compare space used by three different options to store a matrix of 1000x1000 double values in Java
package demo;
import java.util.ArrayList;
public class OccupancyComparer {
static int S = 1000;
static double[][] array_of_double;
static Double[][] array_of_double_obj;
static ArrayList<Double> array_list_of_double_obj;