Skip to content

Instantly share code, notes, and snippets.

View jimwhimpey's full-sized avatar

Jim Whimpey jimwhimpey

View GitHub Profile
@jimwhimpey
jimwhimpey / support.js
Last active April 27, 2016 00:28
Methods currently supported in Flickr's JavaScript SDK
flickr.request().media().post() // Uploading media
flickr.request().media(mediaID).get() // Fetching media
flickr.request().media().search("puppies").get() // Searching media
flickr.request().people(personID).media().get() // Fetching photostreams
flickr.request().people(personID).favorites().media().get() // Fetching favorites
flickr.request().people(personID).albums().get() // Fetching albums
flickr.request().media(mediaID).context(5).album(albumID).get() // Fetching album context
flickr.request().media(mediaID).context(5).photolist().get() // Fetching photolist context
flickr.request().media(mediaID).context(5).photosOf().get() // Fetching photos of context
flickr.request().media(mediaID).context(5).groupPool().get() // Fetching group pool context
@jimwhimpey
jimwhimpey / service-worker.js
Last active November 10, 2022 22:26
An example of our cachable asset manifest that gets inlined into the top of our service worker file during by the build
self.__serviceWorkerManifest= [
// This is the HTML file that we initial load, we normalize
// any Slack client URL to request this same file
{
url: "/boot/client.html",
hash: "52de82b6a380a284b31a6e7be0999050"
// Of course our JS and CSS assets are cached
}, {
url: "https://a.slack-edge.com/bv1-6-9b2646d/client-lazy-components.2ce886f.cache-gantry-1565714987.min.js",
hash: "2ce886f1b462f7437012"
self.addEventListener('fetch', (e) => {
if (assetManifest.includes(e.request.url) {
e.respondWith(
caches
.open(cacheKey)
.then(cache => cache.match(e.request))
.then(response => {
if (response) return response;
return fetch(e.request);
});
@jimwhimpey
jimwhimpey / example-output.js
Created April 4, 2016 19:11
Example of justified-layout output
{
"containerHeight": 1269,
"boxes": [
{
"aspectRatio": 0.5,
"top": 10,
"width": 170,
"height": 340,
"left": 10
},