This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add the custom columns to the rezept post type: | |
add_filter( 'manage_rezept_posts_columns', 'set_custom_edit_rezept_columns' ); | |
function set_custom_edit_rezept_columns($columns) { | |
unset($columns['date']); | |
return array_merge ( $columns, array ( | |
'name' => __('Vor- & Nachname'), | |
'email' => __('E-mail Adresse'), | |
'group_of_people' => __('Personengruppe'), | |
'activation_date' => __('Erstellungsdatum'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Component, | |
ContentChild, | |
ElementRef, | |
EventEmitter, | |
Inject, | |
Optional, | |
Input, | |
NgModule, | |
NgZone, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// due to a classic closure problem | |
for (let i = 0; i < found.length; i++) { | |
setTimeout(() => { | |
found[i].time = + new Date(); | |
// set values in db to see item in pinned list | |
}, i * 2000); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { autoUpdater } from 'electron-updater'; | |
import { dialog, webContents, app, ipcMain, BrowserWindow } from 'electron'; | |
import { ProgressInfo } from 'builder-util-runtime'; | |
import * as log from 'electron-log'; | |
export default class AppUpdater { | |
constructor() { | |
log.transports.file.level = 'debug'; | |
autoUpdater.logger = log; | |
if (process.platform === 'darwin' || process.platform === 'win32') { | |
autoUpdater.checkForUpdatesAndNotify(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* author: [email protected] | |
* purpose: show native notifications accroding to os | |
*/ | |
import { ipcMain, BrowserWindow } from 'electron'; | |
import * as notifier from 'node-notifier'; | |
import * as path from 'path'; | |
import * as elog from 'electron-log'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public moveArrayPosition(arr: any[], oldPosition: number, newPosition: number) { | |
if (newPosition >= arr.length) { | |
let k = newPosition - arr.length + 1; | |
while (k--) { | |
arr.push(undefined); | |
} | |
} | |
arr.splice(newPosition, 0, arr.splice(oldPosition, 1)[0]); | |
return arr; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let url = `${YOUR_URL}`; | |
let promise = new Promise((resolve: any, reject) => { | |
this._httpClient.get(url).toPromise() | |
.then( | |
(res: any) => { | |
resolve(res); | |
}, | |
err => { | |
reject(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* we are going to upload file to s3 via node js by using | |
* aws-sdk - required | |
* busboy - required | |
* uuid - optional - for image renaming purpose | |
* with this library you can upload any kind of file to s3 via node js. | |
*/ | |
const AWS = require('aws-sdk'); | |
const UUID = require('uuid/v4'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { | |
height: 684, // sets the height in pixels of the window. | |
width: 585, // sets the width in pixels of the window. | |
toolbar: 0, // determines whether a toolbar (includes the forward and back buttons) is displayed {1 (YES) or 0 (NO)}. | |
scrollbars: 0, // determines whether scrollbars appear on the window {1 (YES) or 0 (NO)}. | |
status: 0, // whether a status line appears at the bottom of the window {1 (YES) or 0 (NO)}. | |
resizable: 0, // whether the window can be resized {1 (YES) or 0 (NO)}. Can also be overloaded using resizable. | |
left: 0, // left position when the window appears. | |
top: 0, // top position when the window appears. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isVisibleInViewport(id) { | |
var element = document.getElementById(id); | |
var rect = element.getBoundingClientRect(); | |
return ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && | |
rect.right <= (window.innerWidth || document.documentElement.clientWidth) | |
); | |
} |
NewerOlder