This guide is based on the very informative discussion in this article: Using node_sqlite3 with Electron
Install sqlite3
npm install sqlite3 --save
| var connectionString = 'postgres://localhost:5432/postgres'; | |
| var Promise=require('bluebird'); | |
| var knex = require('knex')({ | |
| client: 'pg', | |
| connection: { | |
| user: 'postgres', | |
| database: 'postgres', | |
| port: 5432, |
This guide is based on the very informative discussion in this article: Using node_sqlite3 with Electron
Install sqlite3
npm install sqlite3 --save
process — это объект, позволяющий получить информацию о типе запущенного процесса (рендеринг или основной процесс), версию Chrome и Electron, а также путь до выполняемого js-файла.
Объект File — это абстракция над нативным File, передающая стандартному HTML5 file API путь к физическому расположению файла в файловой системе пользователя.
| app.factory('ArrayService', function(){ | |
| return { | |
| deleteElement: function(array, element) { | |
| var index = array.indexOf(element); | |
| if(index == -1){ | |
| return false; | |
| } | |
| array.splice(index, 1); |
| function MyCustomError(message) { | |
| this.message = message; | |
| this.name = "MyCustomError"; | |
| Error.captureStackTrace(this, MyCustomError); | |
| } | |
| // or util.inherits(MyCustomError, Error); | |
| MyCustomError.prototype = Object.create(Error.prototype); | |
| MyCustomError.prototype.constructor = MyCustomError; |
| 'use strict'; | |
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var del = require('del'); | |
| var uglify = require('gulp-uglify'); | |
| var gulpif = require('gulp-if'); | |
| var exec = require('child_process').exec; | |
| var notify = require('gulp-notify'); |
| import _ from 'lodash'; | |
| import angular from 'angular'; | |
| import 'angular-new-router'; | |
| import 'oclazyload'; | |
| function AppController ( ) { | |
| } | |
| AppController.$routeConfig = []; |
| To install virtualenv via pip | |
| $ pip3 install virtualenv | |
| Note that virtualenv installs to the python3 directory. For me it's: | |
| $ /usr/local/share/python3/virtualenv | |
| Create a virtualenvs directory to store all virtual environments | |
| $ mkdir somewhere/virtualenvs | |
| Make a new virtual environment with no packages |
| app.directive('dynamicHeight', function() { | |
| return { | |
| require: ['^ionSlideBox'], | |
| link: function(scope, elem, attrs, slider) { | |
| scope.$watch(function() { | |
| return slider[0].__slider.selected(); | |
| }, function(val) { | |
| //getting the heigh of the container that has the height of the viewport | |
| var newHeight = window.getComputedStyle(elem.parent()[0], null).getPropertyValue("height"); | |
| if (newHeight) { |
A basic example on how to show fullscreen images (if possible) within a modal using a slide box
Forked from Roberto De la Fuente O.'s Pen Ionic Modal + Slide Box - Fullscreen images.
A Pen by Michael Frohberg on CodePen.