Skip to content

Instantly share code, notes, and snippets.

View sarfarazansari's full-sized avatar

Sarfaraz Ansari sarfarazansari

View GitHub Profile
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();
// 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);
}
import {
Component,
ContentChild,
ElementRef,
EventEmitter,
Inject,
Optional,
Input,
NgModule,
NgZone,
@sarfarazansari
sarfarazansari / function.php
Last active February 14, 2022 04:25
add custom column in wp admin for custom post type
// 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'),