SlideShare a Scribd company logo
1 of 17
Larry cai <larry.caiyu@gmail.com>
Agenda
 Introduction
 Exercise 1: Install Dashing
 Exercise 2:Add one widget
 Exercise 3: Update the view
 Exercise 4: Control the data
 Exercise 5: Update the data with color (coffeescript)
 Exercise 6: Pull the data (jobs)
 Reference
Learn Dashing Widget2 06/16/16
Introduction
Learn Dashing Widget3
 Dashing is a Sinatra based framework that
lets you build beautiful dashboards.
 Key features:
 Use premade widgets, or fully create your own
with scss, html, and coffeescript.
 Widgets harness the power of data bindings to
keep things DRY and simple. Powered by batman.js.
 Use the API to push data to your dashboards, or
make use of a simple ruby DSL for fetching data.
 Drag & Drop interface for re-arranging your
widgets.
Source http://shopify.github.io/dashing
06/16/16
Environment
 Ruby environment (Ruby 1.9.x+, Node.Js 0.10+)
 Ubuntu 14.04
 $ sudo apt-get install ruby, ruby-dev, gem
 $ sudo apt-get install bundler, g++,make,
 $ sudo apt-get install nodejs
 $ sudo gem install dashing
 Windows (use virtualbox with UbuntuVM)
 http://virtualboxes.org/
 http://virtualboxes.org/images/ubuntu-server/
 Or use online service for exercise
http://c9.io , http://codio.com
Learn Dashing Widget4 06/16/16
Environment using c9.io
 https://c9.io/
 New Ruby workspace
 In console:
gem install dashing
Learn Dashing Widget5 06/16/16
Exercise 1: Install Dashing
 Create new dashboard
 $ dashing new dashboard
 $ cd dashboard
 Remove twitter (need both)
 Comment out twitter in Gemfile
 Delete twitter.rb in jobs (dir)
 Start it
 $ bundle
 $ dashing start –p 8080 # default is 3030
 Point your browser to http://localhost:8080
 Or Run panel (if c9.io)
Learn Dashing Widget7 06/16/16
Widget
 Dashboard : dashboard/sample.erb (ruby template)
contains widget
 Dashboard is created with widgets
 Pre-made 50+ widgets (market place)
 Create own widget using css/html
 Widget (set of related files)
 widgetnumbernumber.html –View (html)
 widgetnumbernumber.scss – Style (css)
 widgetnumbernumber.coffee – Data (coffeescript)
Learn Dashing Widget8 06/16/16
Dashboard
Widget
Exercise 2: Add new widget
 Generate `log` widget
 $ dashing generate widget log
 Add into Dashboard
 # update sample.erb
 Check log.html
 Change data-view from Log to Text
 View can be used in other widget “instance”
/”object”
!! Log shall be capitalized for data-view !!!
Learn Dashing Widget9 06/16/16
https://gist.github.com/larrycai/79cf4c63927957a37eba/a909ff38b411eff8cf714c29973a7dc26d9f309e
Exercise 3: Update the view
 Update log.html
 Update log.scss
 Copy the view using list widget css (list.scss -> log.scss)
 Change inside .widget-list -> .widget-log
Learn Dashing Widget10 06/16/16
# log.html
<h1 class="title" data-bind="title"></h1>
<ul class="list-nostyle">
<li>
<span class="label">Access Log</span>
<span class="value" data-bind="access">0</span>
</li>
<li>
<span class="label">Event Log</span>
<span class="value" data-bind="event2">0</span>
</li>
</ul>
<p class="updated-at" data-bind="updatedAtMessage"></p>
Data in Dashing
 Each widget has the data-id (like log), which provides the
URL access point to update the data
 Push data to dashing using REST API (see bottom)
 $ curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "title":
"Current Hour Rate" }' http://<your url>/widgets/log
Learn Dashing Widget11 06/16/16
Exercise 4: Control the Data
 Update the data using curl for welcome message
 Find in the bottom of your dashboard (remove 443,  front of
http)
 Update the data using curl for log
 $ curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", “access”: “100“,
“event2”:”87”}' http://<url>/widgets/log
 Update the data using curl for log
 # Save the request into log.json
 $ curl -d @log.json http://<url>/widgets/log
 Write your own script from anywhere!! (homework)
Learn Dashing12 06/16/16
Data in Dashing (more)
 Push data from anywhere using any language besides curl
 i.e. Python in jenkins job
 Push data in dashing jobs (ruby)
 jobs/sample.rb
Learn Dashing Widget13 06/16/16
CoffeeScript
 CofferScript is like javascript to control views when data
comes (like color) (log.coffeescript)
Learn Dashing Widget14 06/16/16
(Skipped)
Exercise 5: Update the color with data
 <error>/<warning> if there is error, it is red, if there is
warning, it is yellow. Otherwise green
 Use css class to change the color
 Use chrome developer to debug ..
Learn Dashing Widget15 06/16/16
# log.coffee
ready: ->
# This is fired when the widget is done being rendered
onData: (data) ->
# Fired when you receive data
for key,value of data
break if key in ["id","updatedAt"]
id = $(@node).find("##{key}")
console.log(id)
[error,warning] = value.split("/")
if error != "0"
id.attr("class","value-error")
(Skipped)
Exercise 6: Pull data in jobs
 Write log job to simulate fetching the log and send event
to widget
 $ dashing generate job log
 Update the data in every 5 second with random data
 Check sample.rb
Learn Dashing Widget16 06/16/16
Summary
 Dashing is a Radiator framework
 Dashboard consists of Widgets
 Widget:
 Connect with widget view (html/css) (may share one)
coffeescript is used to update view when data comes
 Connect with widget id (expose as HTTP/REST API)
 Update Dashboards can be done
 HTTP/REST API using any language
 Or internal ruby based jobs (crontab) inside Dashing
Learn Dashing Widget17 06/16/16
Reference
 http://shopify.github.io/dashing/
 https://github.com/Shopify/dashing/wiki/Additional-
Widgets
 http://dashing.challengepost.com/submissions
 https://www.andreydevyatkin.com/archives/getting-
started-with-dashing/
 http://www.alexecollins.com/content/team-dashboard-
dashing/
 Log widget gist:
https://gist.github.com/larrycai/79cf4c63927957a37eba
Learn Dashing Widget18 06/16/16

More Related Content

What's hot

Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
 
Database Design for News App
Database Design for News AppDatabase Design for News App
Database Design for News Appscubeuser31
 
MS Sql Server: Feeding Data Into Database
MS Sql Server: Feeding Data Into DatabaseMS Sql Server: Feeding Data Into Database
MS Sql Server: Feeding Data Into DatabaseDataminingTools Inc
 
Oracle Forms: Master Detail form
Oracle Forms: Master Detail formOracle Forms: Master Detail form
Oracle Forms: Master Detail formSekhar Byna
 
PHP: Linguagem + Mysql + MVC + AJAX
PHP: Linguagem + Mysql + MVC + AJAX PHP: Linguagem + Mysql + MVC + AJAX
PHP: Linguagem + Mysql + MVC + AJAX Sérgio Souza Costa
 
Modelagem De Banco De Dados
Modelagem De Banco De DadosModelagem De Banco De Dados
Modelagem De Banco De Dadosmgoberto
 
Banco de Dados I - Aula 09 - Normalização de Dados
Banco de Dados I - Aula 09 - Normalização de DadosBanco de Dados I - Aula 09 - Normalização de Dados
Banco de Dados I - Aula 09 - Normalização de DadosLeinylson Fontinele
 
Unit-4 networking basics in java
Unit-4 networking basics in javaUnit-4 networking basics in java
Unit-4 networking basics in javaAmol Gaikwad
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servletsNuha Noor
 
Obiee and database performance tuning
Obiee and database performance tuningObiee and database performance tuning
Obiee and database performance tuningAmit Sharma
 
07 Modelagem de banco de dados: Modelo Físico
07 Modelagem de banco de dados: Modelo Físico07 Modelagem de banco de dados: Modelo Físico
07 Modelagem de banco de dados: Modelo FísicoCentro Paula Souza
 

What's hot (20)

Tic modulo-25
Tic modulo-25Tic modulo-25
Tic modulo-25
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
Database Design for News App
Database Design for News AppDatabase Design for News App
Database Design for News App
 
JAVA PPT Part-1 BY ADI.pdf
JAVA PPT Part-1 BY ADI.pdfJAVA PPT Part-1 BY ADI.pdf
JAVA PPT Part-1 BY ADI.pdf
 
MS Sql Server: Feeding Data Into Database
MS Sql Server: Feeding Data Into DatabaseMS Sql Server: Feeding Data Into Database
MS Sql Server: Feeding Data Into Database
 
Oracle Database View
Oracle Database ViewOracle Database View
Oracle Database View
 
Oracle Forms: Master Detail form
Oracle Forms: Master Detail formOracle Forms: Master Detail form
Oracle Forms: Master Detail form
 
JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
 
PHP: Linguagem + Mysql + MVC + AJAX
PHP: Linguagem + Mysql + MVC + AJAX PHP: Linguagem + Mysql + MVC + AJAX
PHP: Linguagem + Mysql + MVC + AJAX
 
Logback
LogbackLogback
Logback
 
Modelagem De Banco De Dados
Modelagem De Banco De DadosModelagem De Banco De Dados
Modelagem De Banco De Dados
 
Banco de Dados I - Aula 09 - Normalização de Dados
Banco de Dados I - Aula 09 - Normalização de DadosBanco de Dados I - Aula 09 - Normalização de Dados
Banco de Dados I - Aula 09 - Normalização de Dados
 
AIs Imminent Impact on SEO | What CMOs can do
AIs Imminent Impact on SEO | What CMOs can doAIs Imminent Impact on SEO | What CMOs can do
AIs Imminent Impact on SEO | What CMOs can do
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Unit-4 networking basics in java
Unit-4 networking basics in javaUnit-4 networking basics in java
Unit-4 networking basics in java
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servlets
 
Wordpress Development Introduction
Wordpress Development IntroductionWordpress Development Introduction
Wordpress Development Introduction
 
Obiee and database performance tuning
Obiee and database performance tuningObiee and database performance tuning
Obiee and database performance tuning
 
07 Modelagem de banco de dados: Modelo Físico
07 Modelagem de banco de dados: Modelo Físico07 Modelagem de banco de dados: Modelo Físico
07 Modelagem de banco de dados: Modelo Físico
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 

Viewers also liked

Widget Platform
Widget PlatformWidget Platform
Widget Platformjosemataf
 
Simple REST Services With Sinatra
Simple REST Services With SinatraSimple REST Services With Sinatra
Simple REST Services With SinatraOisin Hurley
 
미래가 알고 싶으세요?
미래가 알고 싶으세요?미래가 알고 싶으세요?
미래가 알고 싶으세요?Seongho Jang
 
Opensource Tools für das Data Center Management
Opensource Tools für das Data Center ManagementOpensource Tools für das Data Center Management
Opensource Tools für das Data Center Managementinovex GmbH
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Commit University
 
Splunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual MachineSplunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual MachineDamien Dallimore
 
Building Jenkins Pipelines at Scale
Building Jenkins Pipelines at ScaleBuilding Jenkins Pipelines at Scale
Building Jenkins Pipelines at ScaleJulien Pivotto
 
Tips for creating a Self Organizing Teams
Tips for creating a Self Organizing TeamsTips for creating a Self Organizing Teams
Tips for creating a Self Organizing TeamsYves Hanoulle
 
WSO2 para o Governo Brasileiro
WSO2 para o  Governo BrasileiroWSO2 para o  Governo Brasileiro
WSO2 para o Governo BrasileiroEdgar Silva
 
Splunk conf2014 - Dashboard Fun - Creating an Interactive Transaction Profiler
Splunk conf2014 - Dashboard Fun - Creating an Interactive Transaction ProfilerSplunk conf2014 - Dashboard Fun - Creating an Interactive Transaction Profiler
Splunk conf2014 - Dashboard Fun - Creating an Interactive Transaction ProfilerSplunk
 
Comparing JVM Web Frameworks - Devoxx France 2013
Comparing JVM Web Frameworks - Devoxx France 2013Comparing JVM Web Frameworks - Devoxx France 2013
Comparing JVM Web Frameworks - Devoxx France 2013Matt Raible
 
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!Eric Wendelin
 

Viewers also liked (20)

Widget Platform
Widget PlatformWidget Platform
Widget Platform
 
Présentation Dashing
Présentation DashingPrésentation Dashing
Présentation Dashing
 
Simple REST Services With Sinatra
Simple REST Services With SinatraSimple REST Services With Sinatra
Simple REST Services With Sinatra
 
미래가 알고 싶으세요?
미래가 알고 싶으세요?미래가 알고 싶으세요?
미래가 알고 싶으세요?
 
Opensource Tools für das Data Center Management
Opensource Tools für das Data Center ManagementOpensource Tools für das Data Center Management
Opensource Tools für das Data Center Management
 
Splunking the JVM
Splunking the JVMSplunking the JVM
Splunking the JVM
 
Widget 101
Widget 101Widget 101
Widget 101
 
Splunk Java Agent
Splunk Java AgentSplunk Java Agent
Splunk Java Agent
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
 
Splunk for JMX
Splunk for JMXSplunk for JMX
Splunk for JMX
 
Splunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual MachineSplunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual Machine
 
Building Jenkins Pipelines at Scale
Building Jenkins Pipelines at ScaleBuilding Jenkins Pipelines at Scale
Building Jenkins Pipelines at Scale
 
Logging & Metrics
Logging & Metrics  Logging & Metrics
Logging & Metrics
 
Tips for creating a Self Organizing Teams
Tips for creating a Self Organizing TeamsTips for creating a Self Organizing Teams
Tips for creating a Self Organizing Teams
 
WSO2 para o Governo Brasileiro
WSO2 para o  Governo BrasileiroWSO2 para o  Governo Brasileiro
WSO2 para o Governo Brasileiro
 
Splunk conf2014 - Dashboard Fun - Creating an Interactive Transaction Profiler
Splunk conf2014 - Dashboard Fun - Creating an Interactive Transaction ProfilerSplunk conf2014 - Dashboard Fun - Creating an Interactive Transaction Profiler
Splunk conf2014 - Dashboard Fun - Creating an Interactive Transaction Profiler
 
Comparing JVM Web Frameworks - Devoxx France 2013
Comparing JVM Web Frameworks - Devoxx France 2013Comparing JVM Web Frameworks - Devoxx France 2013
Comparing JVM Web Frameworks - Devoxx France 2013
 
Rails Best Practices
Rails Best PracticesRails Best Practices
Rails Best Practices
 
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
 
RequireJS & Handlebars
RequireJS & HandlebarsRequireJS & Handlebars
RequireJS & Handlebars
 

Similar to Learn Dashing Widget in 90 minutes

Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.DrupalCampDN
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
An Introduction to Dashing and Smashing
An Introduction to Dashing and SmashingAn Introduction to Dashing and Smashing
An Introduction to Dashing and SmashingKunal Saha
 
Refresh Austin - Intro to Dexy
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexyananelson
 
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx        Greetings and Salutations.docxCIS407AWk2iLabDefault.aspx        Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docxclarebernice
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolGordon Forsythe
 
How to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentHow to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentAcquia
 
BP204 - Take a REST and put your data to work with APIs!
BP204 - Take a REST and put your data to work with APIs!BP204 - Take a REST and put your data to work with APIs!
BP204 - Take a REST and put your data to work with APIs!Craig Schumann
 
Eat whatever you can with PyBabe
Eat whatever you can with PyBabeEat whatever you can with PyBabe
Eat whatever you can with PyBabeDataiku
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Mark Leusink
 
Drupal Meetup Lisbon
Drupal Meetup LisbonDrupal Meetup Lisbon
Drupal Meetup LisbonPaulo Gomes
 
Convert modules from 6.x to 7.x
Convert modules from 6.x to 7.xConvert modules from 6.x to 7.x
Convert modules from 6.x to 7.xJoão Ventura
 
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニングYoshikazu Aoyama
 
Lab #9 and 10 Web Server ProgrammingCreate a New Folder I s.docx
Lab #9 and 10 Web Server ProgrammingCreate a New Folder  I s.docxLab #9 and 10 Web Server ProgrammingCreate a New Folder  I s.docx
Lab #9 and 10 Web Server ProgrammingCreate a New Folder I s.docxDIPESH30
 
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Damien Carbery
 
Automating Workflows for Analytics Pipelines
Automating Workflows for Analytics PipelinesAutomating Workflows for Analytics Pipelines
Automating Workflows for Analytics PipelinesSadayuki Furuhashi
 

Similar to Learn Dashing Widget in 90 minutes (20)

Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
An Introduction to Dashing and Smashing
An Introduction to Dashing and SmashingAn Introduction to Dashing and Smashing
An Introduction to Dashing and Smashing
 
Refresh Austin - Intro to Dexy
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexy
 
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx        Greetings and Salutations.docxCIS407AWk2iLabDefault.aspx        Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
How to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentHow to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of Development
 
BP204 - Take a REST and put your data to work with APIs!
BP204 - Take a REST and put your data to work with APIs!BP204 - Take a REST and put your data to work with APIs!
BP204 - Take a REST and put your data to work with APIs!
 
Eat whatever you can with PyBabe
Eat whatever you can with PyBabeEat whatever you can with PyBabe
Eat whatever you can with PyBabe
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
Drupal Meetup Lisbon
Drupal Meetup LisbonDrupal Meetup Lisbon
Drupal Meetup Lisbon
 
lab56_db
lab56_dblab56_db
lab56_db
 
lab56_db
lab56_dblab56_db
lab56_db
 
Convert modules from 6.x to 7.x
Convert modules from 6.x to 7.xConvert modules from 6.x to 7.x
Convert modules from 6.x to 7.x
 
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
大規模サイトにおけるユーザーレベルのキャッシュ活用によるパフォーマンスチューニング
 
Lab #9 and 10 Web Server ProgrammingCreate a New Folder I s.docx
Lab #9 and 10 Web Server ProgrammingCreate a New Folder  I s.docxLab #9 and 10 Web Server ProgrammingCreate a New Folder  I s.docx
Lab #9 and 10 Web Server ProgrammingCreate a New Folder I s.docx
 
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
 
Automating Workflows for Analytics Pipelines
Automating Workflows for Analytics PipelinesAutomating Workflows for Analytics Pipelines
Automating Workflows for Analytics Pipelines
 

More from Larry Cai

Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLarry Cai
 
Learn jobDSL for Jenkins
Learn jobDSL for JenkinsLearn jobDSL for Jenkins
Learn jobDSL for JenkinsLarry Cai
 
Learn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90minsLearn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90minsLarry Cai
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90minsLarry Cai
 
Learn ELK in docker
Learn ELK in dockerLearn ELK in docker
Learn ELK in dockerLarry Cai
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer TalkLarry Cai
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90minsLarry Cai
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using dockerLarry Cai
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90minsLarry Cai
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with PythonLarry Cai
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90minsLarry Cai
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Lead changes in software development
Lead changes in software developmentLead changes in software development
Lead changes in software developmentLarry Cai
 
Python in 90mins
Python in 90minsPython in 90mins
Python in 90minsLarry Cai
 
Practical way to experience of Specification by Example
Practical way to experience of Specification by ExamplePractical way to experience of Specification by Example
Practical way to experience of Specification by ExampleLarry Cai
 
Experience from specification_by_examples
Experience from specification_by_examplesExperience from specification_by_examples
Experience from specification_by_examplesLarry Cai
 
Write book in markdown
Write book in markdownWrite book in markdown
Write book in markdownLarry Cai
 
Continuous Integration Introduction
Continuous Integration IntroductionContinuous Integration Introduction
Continuous Integration IntroductionLarry Cai
 
Agile & ALM tools
Agile & ALM toolsAgile & ALM tools
Agile & ALM toolsLarry Cai
 

More from Larry Cai (20)

Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
Learn jobDSL for Jenkins
Learn jobDSL for JenkinsLearn jobDSL for Jenkins
Learn jobDSL for Jenkins
 
Learn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90minsLearn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90mins
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Learn ELK in docker
Learn ELK in dockerLearn ELK in docker
Learn ELK in docker
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer Talk
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90mins
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90mins
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Lead changes in software development
Lead changes in software developmentLead changes in software development
Lead changes in software development
 
Python in 90mins
Python in 90minsPython in 90mins
Python in 90mins
 
Practical way to experience of Specification by Example
Practical way to experience of Specification by ExamplePractical way to experience of Specification by Example
Practical way to experience of Specification by Example
 
Experience from specification_by_examples
Experience from specification_by_examplesExperience from specification_by_examples
Experience from specification_by_examples
 
Write book in markdown
Write book in markdownWrite book in markdown
Write book in markdown
 
Continuous Integration Introduction
Continuous Integration IntroductionContinuous Integration Introduction
Continuous Integration Introduction
 
Agile & ALM tools
Agile & ALM toolsAgile & ALM tools
Agile & ALM tools
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Learn Dashing Widget in 90 minutes

  • 2. Agenda  Introduction  Exercise 1: Install Dashing  Exercise 2:Add one widget  Exercise 3: Update the view  Exercise 4: Control the data  Exercise 5: Update the data with color (coffeescript)  Exercise 6: Pull the data (jobs)  Reference Learn Dashing Widget2 06/16/16
  • 3. Introduction Learn Dashing Widget3  Dashing is a Sinatra based framework that lets you build beautiful dashboards.  Key features:  Use premade widgets, or fully create your own with scss, html, and coffeescript.  Widgets harness the power of data bindings to keep things DRY and simple. Powered by batman.js.  Use the API to push data to your dashboards, or make use of a simple ruby DSL for fetching data.  Drag & Drop interface for re-arranging your widgets. Source http://shopify.github.io/dashing 06/16/16
  • 4. Environment  Ruby environment (Ruby 1.9.x+, Node.Js 0.10+)  Ubuntu 14.04  $ sudo apt-get install ruby, ruby-dev, gem  $ sudo apt-get install bundler, g++,make,  $ sudo apt-get install nodejs  $ sudo gem install dashing  Windows (use virtualbox with UbuntuVM)  http://virtualboxes.org/  http://virtualboxes.org/images/ubuntu-server/  Or use online service for exercise http://c9.io , http://codio.com Learn Dashing Widget4 06/16/16
  • 5. Environment using c9.io  https://c9.io/  New Ruby workspace  In console: gem install dashing Learn Dashing Widget5 06/16/16
  • 6. Exercise 1: Install Dashing  Create new dashboard  $ dashing new dashboard  $ cd dashboard  Remove twitter (need both)  Comment out twitter in Gemfile  Delete twitter.rb in jobs (dir)  Start it  $ bundle  $ dashing start –p 8080 # default is 3030  Point your browser to http://localhost:8080  Or Run panel (if c9.io) Learn Dashing Widget7 06/16/16
  • 7. Widget  Dashboard : dashboard/sample.erb (ruby template) contains widget  Dashboard is created with widgets  Pre-made 50+ widgets (market place)  Create own widget using css/html  Widget (set of related files)  widgetnumbernumber.html –View (html)  widgetnumbernumber.scss – Style (css)  widgetnumbernumber.coffee – Data (coffeescript) Learn Dashing Widget8 06/16/16 Dashboard Widget
  • 8. Exercise 2: Add new widget  Generate `log` widget  $ dashing generate widget log  Add into Dashboard  # update sample.erb  Check log.html  Change data-view from Log to Text  View can be used in other widget “instance” /”object” !! Log shall be capitalized for data-view !!! Learn Dashing Widget9 06/16/16 https://gist.github.com/larrycai/79cf4c63927957a37eba/a909ff38b411eff8cf714c29973a7dc26d9f309e
  • 9. Exercise 3: Update the view  Update log.html  Update log.scss  Copy the view using list widget css (list.scss -> log.scss)  Change inside .widget-list -> .widget-log Learn Dashing Widget10 06/16/16 # log.html <h1 class="title" data-bind="title"></h1> <ul class="list-nostyle"> <li> <span class="label">Access Log</span> <span class="value" data-bind="access">0</span> </li> <li> <span class="label">Event Log</span> <span class="value" data-bind="event2">0</span> </li> </ul> <p class="updated-at" data-bind="updatedAtMessage"></p>
  • 10. Data in Dashing  Each widget has the data-id (like log), which provides the URL access point to update the data  Push data to dashing using REST API (see bottom)  $ curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "title": "Current Hour Rate" }' http://<your url>/widgets/log Learn Dashing Widget11 06/16/16
  • 11. Exercise 4: Control the Data  Update the data using curl for welcome message  Find in the bottom of your dashboard (remove 443, front of http)  Update the data using curl for log  $ curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", “access”: “100“, “event2”:”87”}' http://<url>/widgets/log  Update the data using curl for log  # Save the request into log.json  $ curl -d @log.json http://<url>/widgets/log  Write your own script from anywhere!! (homework) Learn Dashing12 06/16/16
  • 12. Data in Dashing (more)  Push data from anywhere using any language besides curl  i.e. Python in jenkins job  Push data in dashing jobs (ruby)  jobs/sample.rb Learn Dashing Widget13 06/16/16
  • 13. CoffeeScript  CofferScript is like javascript to control views when data comes (like color) (log.coffeescript) Learn Dashing Widget14 06/16/16
  • 14. (Skipped) Exercise 5: Update the color with data  <error>/<warning> if there is error, it is red, if there is warning, it is yellow. Otherwise green  Use css class to change the color  Use chrome developer to debug .. Learn Dashing Widget15 06/16/16 # log.coffee ready: -> # This is fired when the widget is done being rendered onData: (data) -> # Fired when you receive data for key,value of data break if key in ["id","updatedAt"] id = $(@node).find("##{key}") console.log(id) [error,warning] = value.split("/") if error != "0" id.attr("class","value-error")
  • 15. (Skipped) Exercise 6: Pull data in jobs  Write log job to simulate fetching the log and send event to widget  $ dashing generate job log  Update the data in every 5 second with random data  Check sample.rb Learn Dashing Widget16 06/16/16
  • 16. Summary  Dashing is a Radiator framework  Dashboard consists of Widgets  Widget:  Connect with widget view (html/css) (may share one) coffeescript is used to update view when data comes  Connect with widget id (expose as HTTP/REST API)  Update Dashboards can be done  HTTP/REST API using any language  Or internal ruby based jobs (crontab) inside Dashing Learn Dashing Widget17 06/16/16
  • 17. Reference  http://shopify.github.io/dashing/  https://github.com/Shopify/dashing/wiki/Additional- Widgets  http://dashing.challengepost.com/submissions  https://www.andreydevyatkin.com/archives/getting- started-with-dashing/  http://www.alexecollins.com/content/team-dashboard- dashing/  Log widget gist: https://gist.github.com/larrycai/79cf4c63927957a37eba Learn Dashing Widget18 06/16/16