Skip to content

Content classified under "Tutorial"

Page 8 of 12

Consistent Testing electron-settings

April 6, 2017Categories: Software, Tutorial
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 to get , set…

Delete Dependent Entries of a Table in Oracle PL/SQL

March 13, 2017Categories: Software, Tutorial
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 to is as follows: Scan…

Poor Man's Mocks in TypeScript

March 7, 2017Categories: Software, Tutorial
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: The code would use an angular service named PathService which, for the purpose of this test only has a…

WordPress with HTTPS on Dreamhost and CloudFlare

January 25, 2017Categories: IT, Tutorial
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 Use CloudFlare free account Wordpress 4.7.1 at the time of writing Initialisation From the Dreamhost Panel, select Domains…

Scan Decorated Classes in Typescript

December 21, 2016Categories: Software, Tutorial
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 to provide a list of…

Make Electron Work with Sqlite3

December 16, 2016Categories: Software, Tutorial
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 I've checked the installation and it was OK (got the…

Make Electron work with Knex.js

December 16, 2016Categories: Software, Tutorial
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 Module not…

Electron AppSend Menu Command to Angular App

December 9, 2016Categories: Software, Tutorial
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', (where open() is a method). I need to make my angular app work when a menu item is clicked (think: I…

List Columns in a ResultSet

December 8, 2016Categories: Software, Tutorial
In order to list all columns in a JDBC ResultSet (e.g. for debug purposes), you need to iterate through its metadata: Note: Column numbers start from 1, not 0 (hence the md.getColumnName(i + 1) above). I usually wrap this in a if(logger.isTraceEnabled()) so it doesn't get triggered all the…

All categories