Skip to content

Instantly share code, notes, and snippets.

View samie's full-sized avatar
Working from home

Sami Ekblad samie

Working from home
View GitHub Profile
samie /
Last active November 6, 2023 16:30
Steps to install Discourse in a VM using Multipass
## Multipass on macOS
# Download and install: open
## Create Discourse VM and open shell
multipass launch --disk 8G --memory 4G --name discourse-server && multipass shell discourse-server
## Install NVM and Node 18 LTS
curl -o- | bash && source ~/.bashrc && nvm install v18.18.2
## Install yarn
<paper-drawer-title photo="face.png" name="Jonathan Lee" email=""></paper-drawer-title>
<paper-drawer-subheader>Items with icon</paper-drawer-subheader>
<paper-drawer-icon-item icon="icons:mail">All mail</paper-drawer-icon-item>
<paper-drawer-icon-item icon="icons:delete">Trash</paper-drawer-icon-item>
<paper-drawer-icon-item icon="icons:error">Spam</paper-drawer-icon-item>
samie /
Created September 2, 2015 08:10
Realtime updates from Spring Data REST repository to Vaadin UI
public class DemoApplication {
public static void main(String[] args) {, args);
public WidgetSet getAddonCDNWidgetSet() {
return new WidgetSet();
samie /
Last active November 8, 2016 06:17
Spring Initializr Vaadin demo app,
package demo;
import com.vaadin.annotations.Theme;
import com.vaadin.server.VaadinRequest;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
samie /
Last active February 15, 2018 15:41
Minimal Standalone Vaadin Application Jar with Maven (~ 7.7MB)
package org.vaadin.lightvaadin;
import com.vaadin.server.VaadinServlet;
import java.util.EventListener;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
samie /
Last active June 19, 2018 06:42
Using CORS with Vaadin
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = MyVaadinUI.class)
public static class MyCORSServlet extends VaadinServlet {
* Override to handle the CORS requests.
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException,