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
<link rel='manifest' href='/manifest.json'> | |
<script> | |
// Check compatibility for the browser we're running this in | |
if ("serviceWorker" in navigator) { | |
if (navigator.serviceWorker.controller) { | |
console.log("[PWA Builder] active service worker found, no need to register"); | |
} else { | |
// Register the service worker | |
navigator.serviceWorker |
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
// the cache version gets updated every time there is a new deployment | |
const CACHE_VERSION = 10; | |
const CURRENT_CACHE = `main-${CACHE_VERSION}`; | |
// these are the routes we are going to cache for offline support | |
const cacheFiles = ['/', '/about-me/', '/projects/', '/offline/']; | |
// on activation we clean up the previously registered service workers | |
self.addEventListener('activate', evt => | |
evt.waitUntil( |
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
// this is the background code... | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { |
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 numpy as np | |
from scipy.optimize import OptimizeResult | |
""" | |
scipy.optimize.minimize(..., method=func) | |
where func = one of the functions below | |
""" | |
def sgd( |
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
/* | |
Recusrsively add a list of files from a named foler to a sheet | |
*/ | |
function main() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var searchMenuEntries = [{ | |
name: "List Folder Content Recursively", | |
functionName: "start" | |
}]; |
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
""" | |
A collection of helper functions for optimization with JAX. | |
UPDATE: This is obsolete now that `jax.scipy.optimize.minimize` is exists! | |
""" | |
import numpy as onp | |
import scipy.optimize | |
from jax import grad, jit | |
from jax.tree_util import tree_flatten, tree_unflatten | |
from jax.flatten_util import ravel_pytree |