Skip to content

Instantly share code, notes, and snippets.

View ahkohd's full-sized avatar
🔨
Building

Victor Aremu ahkohd

🔨
Building
View GitHub Profile
@ahkohd
ahkohd / main.js
Last active November 14, 2018 11:06
Work around for Electron.JS Frameless window White Bar Bug After Maximize Cycle main thread custom maximize and restore event handler. main.js/electron.js https://medium.com/@victoraremu/fix-electron-js-frameless-window-white-bar-bug-after-maximize-cycle-fc1c59f4758c
const {ipcMain} = require('electron');
// to store the restore window screen width and height and position…
let restoreWindowSave;
//...
function createWindow () {
// Create the browser window logics.
let win = new BrowserWindow({ width: 800, height: 600 });
@ahkohd
ahkohd / render.js
Last active November 14, 2018 10:58
Work Around for Electron.JS Frameless window White Bar Bug After Maximize Cycle render process code snippet. https://medium.com/@victoraremu/fix-electron-js-frameless-window-white-bar-bug-after-maximize-cycle-fc1c59f4758c
import { remote, screen, ipcRenderer } from 'electron';
// …
customMaximize()
 {
// windows dimension and positon {width, height, x, y}
let resDetails = remote.getCurrentWindow().getBounds();
// use ipcRender to send custom-resize event to main thread to invoke the custom resize event handler to resize the window….
@ahkohd
ahkohd / index.html
Created November 14, 2018 11:00
Work Around For Electron.JS Frameless window White Bar Bug After Maximize Cycle index.html (example) https://medium.com/@victoraremu/fix-electron-js-frameless-window-white-bar-bug-after-maximize-cycle-fc1c59f4758c
<!-- ... -->
<button id="btn-max">Maximize</button>
<button id="btn-res">Unmaximize/Restore</button>
<!-- ... -->

Privacy Policy

Verge Games built the Ziggy Hover app as an Ad Supported app. This SERVICE is provided by Verge Games at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Ziggy Hover unless otherwise defined in this Privacy Policy.

function ObjectToUrlEncode(data)
{
return Object.entries(data).reduce((accumulator, current) => {
return `${accumulator}&${current[0]}=${current[1]}`;
}, '').substring(1);
}
console.log(ObjectToUrlEncode({name: "victor", age: 12, line: 13}));
// OUTPUT: "name=victor&age=12&line=13"
import {
Pipe,
PipeTransform
} from '@angular/core';
@Pipe({
name: 'PipeForm'
})
export class FormPipe implements PipeTransform {
// transforms the pipe input and returns a string following this format `[[<input/>]]`
import {
Component,
ViewContainerRef,
AfterViewInit,
Renderer2
} from '@angular/core';
@Component({
selector: 'ngx-pipeform',
template: `<ng-content></ng-content>`,
@ahkohd
ahkohd / .zshrc
Created November 28, 2019 06:55
My zsh config and iTerm color palate.
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block, everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@ahkohd
ahkohd / .zshrc
Created November 28, 2019 06:55
My zsh config and iTerm color palate.
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block, everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
import { remote, BrowserWindow } from 'electron';
const fadeWindowOut = (
_window: BrowserWindow,
step: number = 0.1,
fadeEveryXSeconds: number = 10
) => {
let opacity = _window.getOpacity();
const interval = setInterval(() => {
if (opacity <= 0) window.clearInterval(interval);