Skip to content

Instantly share code, notes, and snippets.

@frankko
frankko / Instapaper AMP.txt
Last active October 20, 2015 17:36
Updates the Instapaper bookmarklet to send the AMP HTML version of a page, if available
javascript:function%20iprl5(){var%20d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location;try{if(!b)throw(0);d.title='(Saving...)%20'+d.title;if(document.querySelector('link[rel="amphtml"]')){var%20ampURL=document.querySelector('link[rel="amphtml"]').href;}else{var%20ampURL=l.href;}z.setAttribute('src',l.protocol+'//www.instapaper.com/j/ct1Xqh06honc?a=read-later&u='+encodeURIComponent(ampURL)+'&t='+(new%20Date().getTime()));b.appendChild(z);}catch(e){alert('Please%20wait%20until%20the%20page%20has%20loaded.');}}iprl5();void(0)
@frankko
frankko / sketchmenus.md
Created April 20, 2015 14:17
Dump of Sketch 3.3 menu item commands
  • About Sketch -> orderFrontStandardAboutPanel:
  • Preferences… -> openPreferencesWindow:
  • Check For Updates... -> checkForUpdates:
  • Registration... -> purchaseAction:
  • Feedback... -> feedback:
  • Connect to Mirror... -> iOSConnectAction:
  • No Services Apply -> _noServicesApplyAction:
  • Services Preferences… -> _configureServicesMenu:
  • Hide Sketch -> hide:
  • Hide Others -> hideOtherApplications:
@frankko
frankko / sketchplugins-update.php
Created April 15, 2015 13:04
Update all cloned Sketch plugins
#!/usr/bin/php
<?php
// run this by doing `php /path/to/sketchplugins-update.php`. That's it. Be sure to edit the two following bits:
// change this to the path of your Sketch plugin directory. Don't forget the / at the end.
$pluginsDir = '/full/path/to/com.bohemiancoding.sketch3/Plugins/';
// Exclude folder names from being updated. Useful if you are a plugin developer.
$blacklist = Array(
@frankko
frankko / crasher.js
Last active August 29, 2015 14:18
Sketch 3.3 Crasher [zoomToFitRect]
// Worked in Sketch 3.2, crashes 3.3
var doc = context.document;
var view = [doc currentView];
var all_rect = [GKRect new];
all_rect.x = 0;
all_rect.y = 0;
all_rect.width = 2000;
all_rect.height = 3000;
@frankko
frankko / keybase.md
Created April 2, 2014 15:25
keybase.io proof

Keybase proof

I hereby claim:

  • I am frankko on github.
  • I am frankko (https://keybase.io/frankko) on keybase.
  • I have a public key whose fingerprint is A19B 51D6 B5FC 99C6 7892 C62F F44D BA8B BDBC 619C

To claim this, I am signing this object: