Skip to content

Instantly share code, notes, and snippets.

// ... imports
export default class DeckController {
private facadeService:IFacadeService;
constructor(facadeService:IFacadeService) {
this.facadeService = facadeService;
}
public getDecks():IDeck[] {
// ... imports
export default class FacadeService implements IFacadeService {
private dataService:IDataService;
private uiStateService:IUIStateService;
constructor(dataService:IDataService, uiStateService:IUIStateService) {
this.dataService = dataService;
this.uiStateService = uiStateService;
}
@SomeKay
SomeKay / index.js
Last active August 21, 2018 05:51
var remote = require('remote');
var Tray = remote.require('tray');
var Menu = remote.require('menu');
var path = require('path');
var trayIcon = null;
if (process.platform === 'darwin') {
trayIcon = new Tray(path.join(__dirname, 'img/tray-iconTemplate.png'));
}
'use strict';
var nconf = require('nconf').file({file: getUserHome() + '/sound-machine-config.json'});
function saveSettings(settingKey, settingValue) {
nconf.set(settingKey, settingValue);
nconf.save();
}
function readSettings(settingKey) {
@SomeKay
SomeKay / index.js
Created August 4, 2015 21:14
index.js belonging to main window
'use strict';
var soundButtons = document.querySelectorAll('.button-sound');
for (var i = 0; i < soundButtons.length; i++) {
var soundButton = soundButtons[i];
var soundName = soundButton.attributes['data-sound'].value;
prepareButton(soundButton, soundName);
}
@SomeKay
SomeKay / index.css
Created August 4, 2015 19:10
Undraggable buttons in index.css
.button-sound {
...
-webkit-app-region: no-drag;
}
@SomeKay
SomeKay / index.css
Created August 4, 2015 19:09
Body and html part of index.css
html,
body {
...
-webkit-app-region: drag;
...
}
@SomeKay
SomeKay / main.js
Created August 4, 2015 19:00
main.js with browser definitions for the sound machine
'use strict';
var app = require('app');
var BrowserWindow = require('browser-window');
var mainWindow = null;
app.on('ready', function() {
mainWindow = new BrowserWindow({
frame: false,
@SomeKay
SomeKay / index.html
Last active August 29, 2015 14:26
Basic sound machine layout
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sound Machine</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="css/index.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="main" class="container-fluid">
@SomeKay
SomeKay / index.html
Created August 4, 2015 18:28
Hello, world index.html
<h1>Hello, world!</h1>