Skip to content

Instantly share code, notes, and snippets.

View valioDOTch's full-sized avatar

Pat Mächler valioDOTch

View GitHub Profile
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 9, 2024 08:18
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.

@stevenswafford
stevenswafford / google-dorks
Created June 6, 2015 05:57
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@nicoder
nicoder / 20150202_sonic_pi.rb
Created February 2, 2015 05:06
20150202 sonic pi (start of the bass line of queen's 'another one bites the dust')
use_bpm 90
live_loop :bass do
use_synth :fm
use_synth_defaults release: 0.2
play_pattern_timed [45, 43], [0.25]
play_pattern_timed [40, 40], [1]
play_pattern_timed [40], [1.75]
play_pattern_timed [40, 40, 40, 43, 40, 45],
[0.25, 0.5, 0.5, 0.5, 0.25, 1.75]
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter