Skip to content

Instantly share code, notes, and snippets.

View nisimjoseph's full-sized avatar

Nisim Joseph nisimjoseph

View GitHub Profile
export type TaskPriority = "user-blocking" | "user-visible" | "background";
export type SchedulerPostTaskOptions = {
// This priority is immutable and overrides the
// TaskController's priority.
priority?: TaskPriority;
delay?: number;
signal?: TaskSignal;
};
@jame-zhang
jame-zhang / OpenUrl_Chrome.alfredworkflow
Created December 6, 2018 11:50
open url or chrome password setting tab in chrome, if chrome is running then make new tab, otherwise make new window
on alfred_script(q)
if not (q starts with "http://") and not (q start with "pw")
set q to "http://" & q
end if
tell application "/Applications/Google Chrome.app"
if it is running then
if (q start with "pw")
open location "chrome://settings/passwords"
else
open location q
@ThomasBurleson
ThomasBurleson / tickets.facade.md
Last active February 22, 2024 07:41
Using ngrx with Effects + Facades

NgRx State Management with TicketFacade

Facades are a programming pattern in which a simpler public interface is provided to mask a composition of internal, more-complex, component usages.

When writing a lot of NgRx code - as many enterprises do - developers quickly accumulate large collections of actions and selectors classes. These classes are used to dispatch and query [respectively] the NgRx Store.

Using a Facade - to wrap and blackbox NgRx - simplifies accessing and modifying your NgRx state by masking internal all interactions with the Store, actions, reducers, selectors, and effects.

For more introduction, see Better State Management with Ngrx Facades

@Piasy
Piasy / install_ffmpeg.sh
Last active April 14, 2024 05:40
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@samthor
samthor / shadowlisten.js
Last active May 18, 2020 18:55
Listener to provide up-to-date Shadow DOM focus events
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2024 16:24
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@jensarps
jensarps / detectIDB.js
Last active April 16, 2019 12:35
Script to detect buggy IndexedDB implementations
(function (name, definition, global) {
if (typeof define === 'function') {
define(definition);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = definition();
} else {
global[name] = definition();
}
})('detectIDB', function () {
<!DOCTYPE HTML>
<html>
<head>
<title>T11</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #000000;
@arielsalminen
arielsalminen / converts-webfont-to-base64.js
Last active August 28, 2020 06:07
Convert Google WOFF font to base64 format and inline to <head> of document
// Get binary file using XMLHttpRequest
function getBinary(file) {
var xhr = new XMLHttpRequest();
xhr.open("GET", file, false);
xhr.overrideMimeType("text/plain; charset=x-user-defined");
xhr.send(null);
return xhr.responseText;
}
// Base64 encode binary string