Skip to content

Instantly share code, notes, and snippets.

View oneEyedSunday's full-sized avatar
🤙
Working from home

Idiakose O. Sunday oneEyedSunday

🤙
Working from home
View GitHub Profile
@sean-nicholas
sean-nicholas / auto-logout.ts
Last active September 2, 2019 22:14
auto logout zone
import { Router } from '@angular/router';
import { AuthService } from './auth.service';
import { Injectable, NgZone } from '@angular/core';
import * as store from 'store';
const MINUTES_UNITL_AUTO_LOGOUT = 5 // in Minutes
const CHECK_INTERVALL = 1000 // in ms
const STORE_KEY = 'lastAction';
@Injectable()
@chiller
chiller / Readme.md
Last active June 11, 2023 11:04
ab benchmark file upload
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active December 23, 2025 00:39 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@daverickdunn
daverickdunn / list_in_filter.js
Last active January 15, 2025 19:28
DynamoDB Scan FilterExpression item IN list
const listToObjectMappings = (list) => {
let x = {}
for (var i=0; i<list.length; i++){
x[':' + i.toString()] = list[i]
}
return x
}
let statuses = ['available', 'in-transit', 'delivered']
let mappings = listToObjectMappings(statuses)
@boid-com
boid-com / squirrelHandler.js
Created June 24, 2018 05:01
Squirrel shortcut fix
var path = require('path');
var spawn = require('child_process').spawn;
var debug = require('debug')('electron-squirrel-startup');
var app = require('electron').app;
var appInfo = require('../package.json')
console.log(path.resolve(path.dirname(process.execPath),'..',`app-` + appInfo.version,path.basename(process.execPath)))
var run = function(args, done) {
var updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 23, 2026 10:38
crack activate Office on mac with license file
@brachi-wernick
brachi-wernick / ComponentCanDeactivate.ts
Created December 13, 2017 17:43
ComponentCanDeactivate generic class to handle can deactivate
import {HostListener} from "@angular/core";
export abstract class ComponentCanDeactivate {
abstract canDeactivate(): boolean;
@HostListener('window:beforeunload', ['$event'])
unloadNotification($event: any) {
@btroncone
btroncone / subscription-cleanup.md
Last active April 19, 2022 22:29
Cleaning up subscriptions in Angular

Which do you prefer?

Adding to common sub, calling subscription.unsubscribe() in ngOnDestroy:

export class MyComponent {
  private _subscription: Subscription;
  
  ngOnInit() {
    this._subscription = myObservable
@talkingmoose
talkingmoose / Download and Install Microsoft product.zsh
Last active April 22, 2026 12:51
**Download the latest version of this script from: https://gist.github.com/b6637160b65b751824943ede022daa17 .** Downloads and installs the latest available Microsoft product specified directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server every month.
#!/bin/zsh
:<<'ABOUT_THIS_SCRIPT'
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
bill@talkingmoose.net
https://gist.github.com/b6637160b65b751824943ede022daa17
@avinmathew
avinmathew / index.jsx
Created August 8, 2017 11:54
Multiple layouts with React Router v4
import React from "react"
import { Route, Switch } from "react-router-dom"
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => (
<Route {...rest} render={props => (
<Layout>
<Component {...props} />
</Layout>
)} />
)