czwartek, 21 lutego 2019

Hack Week - Browsersync integration for Online

Recently my LibreOffice work is mostly focused on the Online. It's nice to see how it is growing with new features and has better UI. But when I was working on improving toolbars (eg. folding menubar or reorganization of items) I noticed one annoying thing from the developer perspective. After every small change, I had to restart the server to provide updated content for the browser. It takes few seconds for switching windows, killing old server then running new one which requires some tests to be passed.

Last week during the Hack Week funded by Collabora Productivity I was able to work on my own projects. It was a good opportunity for me to try to improve the process mentioned above.

I've heard previously about browsersync so I decided to try it out. It is a tool which can automatically reload used .css and .js files in all browser sessions after change detection. To make it work browsersync can start proxy server watching files on the original server and sending events to the browser clients if needed.

What is the advantage? Developer tools in the browser are not good enough?

  • Changes tracked by git - no need to copy changes from the browser's developer tools to the source files
  • You can setup testing matrix with all apps (writer, calc, impress) and all is reloaded instantly at one time (even on other devices like tablet or smartphone)
  • Fast prototyping

Disadvantages

  • You have to remember to run syntax tests before commiting the changes

To integrate browsersync I needed to do some build system changes. First, all static files are served from 'loleaflet/dist' directory. These files are not the original sources but copies. I modified the Makefiles to create symlinks instead if the browsersync is activated. Thanks to that we can modify sources tracked by git and proxy can detect changes.

To try it out on your own:

  1. Delete your 'loleaflet/dist' folder or
    make clean
    you might need to delete generated 'Makefile' if repository was used before
  2. Install browsersync:
    npm install -g browser-sync
  3. Run 'configure' script with additional --enable-browsersync argument
  4. Run server with:
    LOOL_SERVE_FROM_FS=1 make run
  5. In the other console run browsersync:
    make sync-[writer|calc|impress]
More information can be found in: 'loleaflet/README'

In the video below you can see how it works:

Next step will be to allow browsersync usage with cloud storage integrations like richdocuments, I noticed also some issues with access from other devices (app is still using original server for some resources).

wtorek, 27 marca 2018

Highlight colors customization for Calc

In Calc it is possible to activate "Value Highlighting" mode (Ctrl + F8). When activated, Calc displays cell contents in different colors, depending on type. By default Text cells are formatted in black, formulas in green, number cells in blue, and protected cells are shown with light grey background, no matter how their display is formatted. There was no possibility to change default colors what could be a problem for a color blind person. During my work for Collabora Productivity I introduced new entries to the "Application colors" tab in Calc options to fix this issue:

czwartek, 15 lutego 2018

Nixie clock #3 - NodeMCU & auto time update

Previous post: Nixie clock #2

Recently I finished my clock (electronics). All the code is uploaded on my github profile: clock repo.
I added automatic time update done by NodeMCU which connects to my predefined WiFi Access Point and after receiving the time, sends it over UART to the atmega microcontroller.

Spaghetti for testing and results:

Now I should design a case for this device...

wtorek, 2 stycznia 2018

Connect to the bluetooth serial port in linux

From time to time I use my bluetoth module HC-05 to communicate with microcontroller. Every time I have the same problem because I don't remember how to do that. Short receipe working for me (at least for openSUSE):
 sudo bluetoothctl  
 power on  
 agent on  
 scan on  
 pair <MAC>  
Then:
 sudo killall rfcomm  
 sudo rfcomm connect /dev/rfcomm0 <MAC> 1  

/dev/rfcomm0 is ready to use now.

source

piątek, 22 grudnia 2017

Nixie clock #2 - multiplexing

Previous post: Nixie clock #1

I had to choose my project for embedded systems classes (containing some kind of display, communication module, some other parts like sensors, etc.) and I proposed to continue with my nixie clock. I will have to add automatic time downloading from the internet. I'm going to use cheap & popular wifi module esp8366:


Today I finished my second PCB for this project, board performing signal multiplexing for tubes. Inputs are HV from the boost converter, digit and tube activation signals. On the output correct tube gets power supply and specified number pin is driven. I put a lot of work into it (done in period of 2-3 weeks in the evenings), fortunately the board works:



Nice views by copper & salts during etching so waiting wasn't too boring :)

środa, 6 grudnia 2017

Serverless architecture

Recently I've heard about idea called "serverless architecture". This is the next architecture proposal for web applications after very popular in recent years microservices. To be short, in this approach developers don't have to care much about server-side infrastructure. Great description can be found at martinfowler.com. Serverless concepts can be found in big providers' platforms like AWS or Azure. As I see on Azure platform there is 1M free function invocations per month what allows to create & start small applications for free. Development can be rapid due to provided integrations (in Azure - Logic Apps) with popular services (Salesforce, Office 365, Twitter, Dropbox, Google services).