Laur's blog
  • Home
  • About
  • Support my work
Sign in Subscribe
My Raspberry Pi 3 Config.txt for Volumio
config

My Raspberry Pi 3 Config.txt for Volumio

My stable configuration file for Volumio looks like this now: 1. Basics: initramfs volumio.initrd gpu_mem=16 max_usb_current=1 disable_splash=1 2. Sound card: dtparam=audio=on dtparam=i2c_arm=on dtoverlay=hifiberry-dacplus dtoverlay=lirc-rpi:gpio_in_pin=26 3. WaveShare screen: max_usb_current=1
Apr 21, 2017 1 min read
Configure Volumio with PiFi DIGI DAC+
berry

Configure Volumio with PiFi DIGI DAC+

The other day I've got a Chinese clone of HiFiBerry, a PiFi DAC+ v2.0: Here are the steps to configure it with Volumio. First, you need to install Volumio 2 (2.129 at the moment of writing). You need to configure it to e.g. connect to
Apr 20, 2017 2 min read
Change the File Extension in Typescript (or Javascript)
change

Change the File Extension in Typescript (or Javascript)

TL;DR: You need to get the root name (without the extension) and append the new extension. Then, it only depends on how tolerant you are. The other day I figured I needed a function to change the file extension (from a .jpg to a .nfo). Since I haven'
Apr 18, 2017 1 min read
Consistent Testing  electron-settings
electron

Consistent Testing electron-settings

TL;DR: Delete the settings file before starting the test. Today I implemented a simple wrapper over the electron-settings functionality to gibe me access to a set of properties via get/set methods. My scenario is simple: I have a property named path.backup and I want to be able
Apr 6, 2017 1 min read
We had to hire an architect
house

We had to hire an architect

Well, our constructor told us we need an architect. So I did some digging... Payment Scheme I found here a way to schedule payments to the architect: Phase Activity Percentage Effort Conception Etudes préliminaires 5 % 33 h Avant projet sommaire (APS) 10 % 66 h Avant projet détaillé (APD) 10 % 66
Mar 16, 2017 2 min read
Delete Dependent Entries of a Table in Oracle PL/SQL
batch

Delete Dependent Entries of a Table in Oracle PL/SQL

The other day I had a task to clean up a database which was populated with a list of records. Unfortunately, my main table is linked to a host of other tables via foreign key dependencies and, to make things worse, no CASCADE constraints are specified. The process I want
Mar 13, 2017 3 min read
Poor Man's Mocks in TypeScript
anonymous

Poor Man's Mocks in TypeScript

Today I went against my better judgement of usign a mock framework and decided to create my own mocks to allow coverage testing for an IPC-calling code. My reference code I wanted to test is: export class ScanTriggerEvent { name: string = 'scan' constructor(private pathService: PathsService) {} /** * Send a scan
Mar 7, 2017 1 min read
Convert m4a to mp3 Using Ffmpeg on Windows (and Git Bash)
bash

Convert m4a to mp3 Using Ffmpeg on Windows (and Git Bash)

Here's a simple command line to convert m4a files to MP3 on windows: for i in *.m4a; do ./ffmpeg.exe -i "$i" "${i%.m4a}".mp3; done HTH,
Mar 4, 2017
Use "toThrowError" and "toThrow" in TypeScript with Objects
jasmine

Use "toThrowError" and "toThrow" in TypeScript with Objects

TL;DR: wrap your method call in the expect() statement. Instead of expect(obj.method()).toThrow(), write expect( () => { obj.method() }).toThrow(). While in the process of improving the code coverage, I needed to write a test for a method throwing an exception. My initial code would have been something
Mar 2, 2017 1 min read
Fix Angular 2 Tests with Karma
2

Fix Angular 2 Tests with Karma

Below are some fixes I had to apply in order to make Angular 2 tests work with karma. Binding * Error: Can't bind to 'ngModel' since it isn't a known property of 'input' * Solution: Import FormsModulein your test: TestBed.configureTestingModule({ declarations: [AppComponent], imports:
Mar 1, 2017 1 min read
Initialize a Typescript Interface with JSON
array

Initialize a Typescript Interface with JSON

TL;DR: You can initialise a typescript interface using JSON objects. On my quest to load and save objects as JSON, I found that you can convert a JSON object to an interface via something called type assertion. Basically, if you have an interface: export interface PathInterface { path: string enabled:
Feb 21, 2017 1 min read
Check Duplicated Paths with LoDash (and Angular 2)
check

Check Duplicated Paths with LoDash (and Angular 2)

One of the things I'm looking at is to be able to create a list of paths I'd want to scan. The first iteration had blind addition to the list. However, this would make the user's responsibility to manage the duplicated paths, which is
Feb 20, 2017 2 min read
Angular 2Refresh Bound Variables from Callback
angular

Angular 2Refresh Bound Variables from Callback

TL;DR: Use ChangeDetectorRef's detectChanges() at the end of your callback code. While developing my electron.js app, I've had the following workflow: * I have an input element and a button * The input element is capable of editing a path * The button triggers a File Open
Jan 31, 2017 1 min read
Applications for EPSO/AD/331/16
ad7

Applications for EPSO/AD/331/16

The number of applications are: No. Section Places Candidates AC 1 Data Analysis and IT Service 30 852 9.5x 2 Digital Workplace, Office Automation and Mobile Computing 25 258 3.4x 3 Enterprise Resource Planning (ERP) 14 208 5.0x 4 ICT Security 49 418 2.9x 5 IT
Jan 27, 2017 1 min read
WordPress with HTTPS on Dreamhost and CloudFlare
cloudflare

WordPress with HTTPS on Dreamhost and CloudFlare

Today I've got my blog work over HTTPS, including admin. Woo-hoo! Below are the steps I used to do it. Prerequisites My configuration is as follows: * Hosting on Dreamhost.com * Use CloudFlare free account * Wordpress 4.7.1 at the time of writing Initialisation From the Dreamhost Panel,
Jan 25, 2017 3 min read
Load FontAwesome Fonts with Webpack 2
awesome

Load FontAwesome Fonts with Webpack 2

TL;DR:: Add the (s)css dependency to your main (s)css file and specify where to find the fonts too. Then use the proper loaders in your webpack.config.js file. The past few days I had trouble loading the font-awesome fonts with webpack. I tried quite a few
Jan 23, 2017 1 min read
Copy File from Local Desktop to Remote Resktop Connection
connection

Copy File from Local Desktop to Remote Resktop Connection

TL;DR: Drag-and-drop doesn't work. Copy&paste does! Before yesterday, my way of moving files between my local desktop and a remote one using MS Remote Desktop Connection involved a 3rd party service like Dropbox or email. Then, a kind soul took pity on me and showed
Jan 19, 2017 1 min read
Multiline Regex in Visual Studio Code
code

Multiline Regex in Visual Studio Code

Setting up a multi-line regular expression in VS code is done by explicitly matching the CR/LF characters using \r?\n. For example, if I want to find all lines starting with a [, including subsequent blank lines, I can do: ^\[.*(\r?\n\s*)* HTH,
Jan 6, 2017
Scan Decorated Classes in Typescript
class

Scan Decorated Classes in Typescript

TL;DR: Make the decorator set a property in the class and look for it. While trying my hand at writing an ORM, I had a problem of initialising the database through a dummy instantiation of some models, without running an explicit command. In java, I can use code generation
Dec 21, 2016 1 min read
Make Electron Work with Sqlite3
electron

Make Electron Work with Sqlite3

The other day I tried to integrate knex with a SQLITE3 back-end. Unfortunately, the instant I've tried to instantiate knex, I've got a lot of errors. After getting rid of them, I found that I can't get sqlite3 to work at all, even though
Dec 16, 2016 1 min read
Make Electron work with Knex.js
electron

Make Electron work with Knex.js

To make my life easier (and because I hate writing SQL statements), I thought of installing an ORM. After some search, I've decided to use knex. Unfortunately, the moment I integrated it into my app, webpack started generating errors like: ERROR in ./~/knex/lib/dialects/maria/index.js
Dec 16, 2016 1 min read
Electron AppSend Menu Command to Angular App
command

Electron AppSend Menu Command to Angular App

TL;DR: In the main process use mainWindow.webContents.send('cmd') and in your Angular component (renderer process) bind it to a method with ipcRenderer.on('cmd', this.open.bind(this)) (where open() is a method). I need to make my angular app work when a
Dec 9, 2016 1 min read
List Columns in a ResultSet
column

List Columns in a ResultSet

In order to list all columns in a JDBC ResultSet (e.g. for debug purposes), you need to iterate through its metadata: // Get the metadata ResultSetMetaData md = rs.getMetaData(); // For each column, list its name for (int i=0;i < md.getColumnCount(); i++) logger.debug("Column :" + i
Dec 8, 2016 1 min read
Make Tomcat Log Stuff to Console (in Eclipse)
configuration

Make Tomcat Log Stuff to Console (in Eclipse)

TL;DR: in your project's src/main/resources add the CONSOLE setting to the log4j.properties file. While trying to add features to a web application, I stumbled on an odd situation: my Eclipse Console would show only log messages for tomcat processes, none of my logs. I&
Dec 7, 2016 1 min read
Skip the EPSO Online Test
apply

Skip the EPSO Online Test

TL;DR:: Replace the end of the application URL from e.g. 1947_en to 1947/apply_en. These days, EPSO is in the habit of launching calls with multiple fields with a twist: each field has its own application page. So, if you just want to browse the fields
Dec 5, 2016 1 min read
← Newer Posts Page 14 of 26 Older Posts →
Laur's blog © 2026
  • Sign up
Powered by Ghost