diff --git a/README.md b/README.md index 303af3a0..c9c3a276 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ - [๐Ÿ’ฐ Cryptocurrency donation via Web3/MetaMask](#-cryptocurrency-donation-via-web3metamask) - [๐Ÿ” Search](#-search) - [๐Ÿ•ธ Related Posts](#-related-posts) - - [๐Ÿ Coinhive](#-coinhive) - [๐Ÿ“ GitHub changelog rendering](#-github-changelog-rendering) - [๐Ÿ† SEO component](#-seo-component) - [๐Ÿ“ˆ Matomo (formerly Piwik) analytics tracking](#-matomo-formerly-piwik-analytics-tracking) @@ -96,22 +95,6 @@ If you want to know how this works, have a look at the respective component unde - [`src/components/molecules/RelatedPosts.jsx`](src/components/molecules/RelatedPosts.jsx) -### ๐Ÿ Coinhive - -Includes a component for mining Monero with JavaScript via [Coinhive](https://coinhive.com). - -screen shot 2018-10-11 at 21 09 49 - -Functionality is opt-in on a post basis. Simply add this to any post's frontmatter to activate it for this post: - -```yaml -coinhive: true -``` - -If you want to know how this works, have a look at the respective component under - -- [`src/components/atoms/Coinhive.jsx`](src/components/atoms/Coinhive.jsx) - ### ๐Ÿ“ GitHub changelog rendering Adds ability to show contents of a changelog, rendered from a `CHANGELOG.md` on GitHub from the given repository. The use case is to enhance release posts about projects hosted on GitHub. Makes use of the GitHub GraphQL API via [gatsby-source-graphql](https://www.gatsbyjs.org/packages/gatsby-source-graphql/). @@ -154,10 +137,10 @@ Site sends usage statistics to my own [Matomo](https://matomo.org) installation. All SVG assets under `src/images/` will be converted to React components with the help of [gatsby-plugin-svgr](https://github.com/zabute/gatsby-plugin-svgr). Makes use of [SVGR](https://github.com/smooth-code/svgr) so SVG assets can be imported like so: -```js +```jsx import { ReactComponent as Logo } from './components/svg/Logo' - +; ``` ### ๐Ÿฌ Typekit component diff --git a/content/photos/2012-04-07-ipad-porn.md b/content/photos/2012-04-07-ipad-porn.md index 7d3fbadc..05cb934b 100644 --- a/content/photos/2012-04-07-ipad-porn.md +++ b/content/photos/2012-04-07-ipad-porn.md @@ -4,6 +4,4 @@ type: photo title: iPad Porn image: ../media/97a44d6080b711e181bd12313817987b_7.jpg date: 2012-04-07 13:43:00+00:00 - -coinhive: true --- diff --git a/content/posts/2007-03-01-adjustment-tool-guide-for-aperture-152.md b/content/posts/2007-03-01-adjustment-tool-guide-for-aperture-152.md index fcc67158..2a71b75d 100644 --- a/content/posts/2007-03-01-adjustment-tool-guide-for-aperture-152.md +++ b/content/posts/2007-03-01-adjustment-tool-guide-for-aperture-152.md @@ -7,7 +7,6 @@ date: 2007-03-01 20:50:32+00:00 tags: - photography - aperture -coinhive: true --- The Adjustment Tool Guide gives an in-depth-view of the Adjustment tool in Aperture. The documentary provided by Apple isn't that what most people were looking for. But Kendall Gelner wrote his own Adjustment Tools Guide originally for the Aperture Version 1.0.1. diff --git a/content/posts/2008-02-26-how-to-quickly-generate-encrypted-logins-on-a-mac-for-htaccess-protected-sites.md b/content/posts/2008-02-26-how-to-quickly-generate-encrypted-logins-on-a-mac-for-htaccess-protected-sites.md index 2cc6fb5c..b834fbd8 100644 --- a/content/posts/2008-02-26-how-to-quickly-generate-encrypted-logins-on-a-mac-for-htaccess-protected-sites.md +++ b/content/posts/2008-02-26-how-to-quickly-generate-encrypted-logins-on-a-mac-for-htaccess-protected-sites.md @@ -10,8 +10,6 @@ tags: - tutorial - macos -coinhive: true - redirect_from: - /2008/02/how-to-quickly-generate-encrypted-logins-on-a-mac-for-htaccess-protected-sites/ --- diff --git a/content/posts/2008-04-04-aperture-file-types.md b/content/posts/2008-04-04-aperture-file-types.md index 87376aa4..43f7a16a 100644 --- a/content/posts/2008-04-04-aperture-file-types.md +++ b/content/posts/2008-04-04-aperture-file-types.md @@ -6,8 +6,6 @@ download: ../media/aperturefiletypes_by_kremalicious.zip author: Matthias Kretschmann date: 2008-04-04T01:55:54.000Z -category: -coinhive: true tags: - goodies - icon diff --git a/content/posts/2008-04-09-changing-the-image-icons-in-mac-os-x-leopard.md b/content/posts/2008-04-09-changing-the-image-icons-in-mac-os-x-leopard.md index 2bdf186a..fd9d8cd8 100644 --- a/content/posts/2008-04-09-changing-the-image-icons-in-mac-os-x-leopard.md +++ b/content/posts/2008-04-09-changing-the-image-icons-in-mac-os-x-leopard.md @@ -6,7 +6,6 @@ author: Matthias Kretschmann date: 2008-04-09 13:13:42+00:00 -coinhive: true tags: - design - tutorial diff --git a/content/posts/2008-04-14-new-automation-helper-for-apples-aperture-released.md b/content/posts/2008-04-14-new-automation-helper-for-apples-aperture-released.md index 3c73428e..26e96807 100644 --- a/content/posts/2008-04-14-new-automation-helper-for-apples-aperture-released.md +++ b/content/posts/2008-04-14-new-automation-helper-for-apples-aperture-released.md @@ -6,7 +6,6 @@ author: Matthias Kretschmann date: 2008-04-14 13:51:39+00:00 -coinhive: true tags: - photography - aperture diff --git a/content/posts/2008-04-17-make-cool-and-clever-text-effects-with-css-text-shadow.md b/content/posts/2008-04-17-make-cool-and-clever-text-effects-with-css-text-shadow.md index bf8f80c9..a4f5e91f 100644 --- a/content/posts/2008-04-17-make-cool-and-clever-text-effects-with-css-text-shadow.md +++ b/content/posts/2008-04-17-make-cool-and-clever-text-effects-with-css-text-shadow.md @@ -10,8 +10,6 @@ tags: - css - tutorial -coinhive: true - redirect_from: - /2008/04/make-cool-and-clever-text-effects-with-css-text-shadow/ --- diff --git a/content/posts/2008-05-04-using-the-canoscan-lide-500f-with-mac-os-x-leopard.md b/content/posts/2008-05-04-using-the-canoscan-lide-500f-with-mac-os-x-leopard.md index 40f972bc..6c89d183 100644 --- a/content/posts/2008-05-04-using-the-canoscan-lide-500f-with-mac-os-x-leopard.md +++ b/content/posts/2008-05-04-using-the-canoscan-lide-500f-with-mac-os-x-leopard.md @@ -6,7 +6,6 @@ image: ../media/canoscanlide500f.jpg date: 2008-05-04 16:04:48+00:00 -coinhive: true tags: - photography - tutorial diff --git a/content/posts/2008-05-05-scan-images-directly-into-apple-aperture.md b/content/posts/2008-05-05-scan-images-directly-into-apple-aperture.md index 40e00a79..6ff00068 100644 --- a/content/posts/2008-05-05-scan-images-directly-into-apple-aperture.md +++ b/content/posts/2008-05-05-scan-images-directly-into-apple-aperture.md @@ -7,7 +7,6 @@ image: ../media/aperturescan.png date: 2008-05-05 04:15:11+00:00 -coinhive: true tags: - photography - aperture diff --git a/content/posts/2008-05-07-high-quality-watermarks-with-aperture.md b/content/posts/2008-05-07-high-quality-watermarks-with-aperture.md index cd5a7695..6c615bfd 100644 --- a/content/posts/2008-05-07-high-quality-watermarks-with-aperture.md +++ b/content/posts/2008-05-07-high-quality-watermarks-with-aperture.md @@ -11,8 +11,6 @@ tags: - aperture - tutorial -coinhive: true - redirect_from: - /2008/05/high-quality-watermarks-with-aperture/ --- diff --git a/content/posts/2008-05-07-the-15-best-new-features-of-aperture-2.md b/content/posts/2008-05-07-the-15-best-new-features-of-aperture-2.md index 46f2e751..f488187c 100644 --- a/content/posts/2008-05-07-the-15-best-new-features-of-aperture-2.md +++ b/content/posts/2008-05-07-the-15-best-new-features-of-aperture-2.md @@ -10,8 +10,6 @@ date: 2008-05-07 19:22:49+00:00 tags: - photography - aperture - -coinhive: true --- There are already some lists like this available on the web and they are always very subjective so I thought I should add my subjective list too. While Aperture was released I was coding this website and had not much time for writing about it. So although a bit late here is my absolutely biased list of my favorite 15 new features included in Apple's Aperture since version 2.0. It's in a nice countdown order ending with the best new feature (to me) at the bottom. Just click on the little screenshots to smoothly zoom to the full version of them. diff --git a/content/posts/2008-05-18-first-aperture-adjustment-plugins-have-arrived.md b/content/posts/2008-05-18-first-aperture-adjustment-plugins-have-arrived.md index 68b51ab6..55a80fcb 100644 --- a/content/posts/2008-05-18-first-aperture-adjustment-plugins-have-arrived.md +++ b/content/posts/2008-05-18-first-aperture-adjustment-plugins-have-arrived.md @@ -9,8 +9,6 @@ date: 2008-05-18 05:00:01+00:00 tags: - photography - aperture - -coinhive: true --- ![Aperture](../media/aperture97.png)With the release of Aperture 2.1 Apple introduced a plugin architecture for adding third party image adjustment and export plugins. Now the first third party image adjustment plugins for Aperture 2.1 have arrived. And they can definitely make you stop roundtripping your pictures to Photoshop and back. For now a total of 14 plugins from 9 companys were announced which are waiting to help you with your Aperture 2 workflow. diff --git a/content/posts/2008-05-28-new-all-in-one-aperture-plug-in-released.md b/content/posts/2008-05-28-new-all-in-one-aperture-plug-in-released.md index 4651cdb9..f8f1c004 100644 --- a/content/posts/2008-05-28-new-all-in-one-aperture-plug-in-released.md +++ b/content/posts/2008-05-28-new-all-in-one-aperture-plug-in-released.md @@ -9,8 +9,6 @@ date: 2008-05-28 15:29:56+00:00 tags: - photography - aperture - -coinhive: true --- ![ApertureEdit](../media/apertureedit_logo.png)Today [Human Software](http://www.humansoftware.com) released an exciting image editing plug-in for Apple's Aperture. It's called [ApertureEdit](http://www.humansoftware.com/pages1200/ApertureEdit/HSapertureedit11.html) and according to Human Software it offers more than 4000 professional effects which you can achieve right within Aperture. diff --git a/content/posts/2008-06-01-chives.md b/content/posts/2008-06-01-chives.md index e7bca7eb..4f3c5b7f 100644 --- a/content/posts/2008-06-01-chives.md +++ b/content/posts/2008-06-01-chives.md @@ -12,8 +12,6 @@ tags: - goodies - wallpaper -coinhive: true - redirect_from: - /first-wallpaper-chives/ --- diff --git a/content/posts/2008-06-03-niepces-camera-obscura-and-the-history-of-the-first-photograph.md b/content/posts/2008-06-03-niepces-camera-obscura-and-the-history-of-the-first-photograph.md index 3fdb91dd..68cd5089 100644 --- a/content/posts/2008-06-03-niepces-camera-obscura-and-the-history-of-the-first-photograph.md +++ b/content/posts/2008-06-03-niepces-camera-obscura-and-the-history-of-the-first-photograph.md @@ -11,8 +11,6 @@ tags: - goodies - icon -coinhive: true - redirect_from: - /new-goodie-niepces-camera-obscura-and-the-history-of-the-first-photograph/ - /4-more-icons-niepces-camera-obscura-v11/ diff --git a/content/posts/2008-06-03-niepces-camera-obscura-wallpaper-pack.md b/content/posts/2008-06-03-niepces-camera-obscura-wallpaper-pack.md index 6bc55176..da119e23 100644 --- a/content/posts/2008-06-03-niepces-camera-obscura-wallpaper-pack.md +++ b/content/posts/2008-06-03-niepces-camera-obscura-wallpaper-pack.md @@ -12,8 +12,6 @@ tags: - goodies - wallpaper -coinhive: true - redirect_from: - /new-goodie-niepces-camera-obscura-wallpaper-pack/ --- diff --git a/content/posts/2008-06-19-ubuntu-as-mac-file-server-and-time-machine-volume.md b/content/posts/2008-06-19-ubuntu-as-mac-file-server-and-time-machine-volume.md index 8ddb0a57..1306dbe7 100644 --- a/content/posts/2008-06-19-ubuntu-as-mac-file-server-and-time-machine-volume.md +++ b/content/posts/2008-06-19-ubuntu-as-mac-file-server-and-time-machine-volume.md @@ -13,8 +13,6 @@ tags: - macos - ubuntu -coinhive: true - redirect_from: - /ubuntu-as-mac-file-server-and-time-machine-volume/trackback/ - 2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/ diff --git a/content/posts/2008-08-22-howto-create-a-mobile-encrypted-aperture-vault.md b/content/posts/2008-08-22-howto-create-a-mobile-encrypted-aperture-vault.md index 27781605..f4cfc558 100644 --- a/content/posts/2008-08-22-howto-create-a-mobile-encrypted-aperture-vault.md +++ b/content/posts/2008-08-22-howto-create-a-mobile-encrypted-aperture-vault.md @@ -11,8 +11,6 @@ tags: - aperture - tutorial - macos - -coinhive: true --- ![Niepce's Aperture Vault](../media/niepces_aperture_vault256.png)When on the road I always take a little mobile hard drive with me where all my referenced Aperture Masters from the past years and my mobile Aperture Vault (backing up the un-referenced Masters from the current year) reside. But being little and mobile also means the external hard drive can easily be lost or stolen exposing all my pictures to the thief. To avoid that you can use encryption so in the case of a lost or theft the data is not accessible by the thief. This can easily be done with [sparse bundle disk images](http://db.tidbits.com/article/9673) so you won't have to encrypt the whole hard drive with additional software. diff --git a/content/posts/2008-09-23-futurama-mars-university-wallpaper.md b/content/posts/2008-09-23-futurama-mars-university-wallpaper.md index 140bf15b..93e57608 100644 --- a/content/posts/2008-09-23-futurama-mars-university-wallpaper.md +++ b/content/posts/2008-09-23-futurama-mars-university-wallpaper.md @@ -6,14 +6,12 @@ image: ../media/Teaser-Mars-U.jpg author: Matthias Kretschmann date: 2008-09-23 23:22:16+00:00 - + tags: - goodies - wallpaper - futurama -coinhive: true - redirect_from: - /new-goodie-futurama-mars-university-wallpaper/ --- diff --git a/content/posts/2008-10-26-the-definite-guide-to-watermarks-in-apple-aperture.md b/content/posts/2008-10-26-the-definite-guide-to-watermarks-in-apple-aperture.md index 2cd5ac08..b735b14e 100644 --- a/content/posts/2008-10-26-the-definite-guide-to-watermarks-in-apple-aperture.md +++ b/content/posts/2008-10-26-the-definite-guide-to-watermarks-in-apple-aperture.md @@ -11,8 +11,6 @@ tags: - photography - aperture -coinhive: true - redirect_from: - /2008/10/the-definite-guide-to-watermarks-in-apple-aperture/ --- diff --git a/content/posts/2008-12-11-how-to-set-a-custom-gravatar-image-in-wordpress-27.md b/content/posts/2008-12-11-how-to-set-a-custom-gravatar-image-in-wordpress-27.md index b195d521..009d976f 100644 --- a/content/posts/2008-12-11-how-to-set-a-custom-gravatar-image-in-wordpress-27.md +++ b/content/posts/2008-12-11-how-to-set-a-custom-gravatar-image-in-wordpress-27.md @@ -11,8 +11,6 @@ tags: - tutorial - wordpress -coinhive: true - redirect_from: - /2008/12/how-to-set-a-custom-gravatar-image-in-wordpress-27/ --- diff --git a/content/posts/2008-12-13-howto-styling-author-comments-with-wordpress-27.md b/content/posts/2008-12-13-howto-styling-author-comments-with-wordpress-27.md index 78681fd8..95b3a4c8 100644 --- a/content/posts/2008-12-13-howto-styling-author-comments-with-wordpress-27.md +++ b/content/posts/2008-12-13-howto-styling-author-comments-with-wordpress-27.md @@ -10,8 +10,6 @@ tags: - design - tutorial - wordpress - -coinhive: true --- ![Wordpress Logo by kremalicious](../media/wordpress-logo.png) diff --git a/content/posts/2009-01-05-the-mac-in-futurama.md b/content/posts/2009-01-05-the-mac-in-futurama.md index 17745d8f..03403886 100644 --- a/content/posts/2009-01-05-the-mac-in-futurama.md +++ b/content/posts/2009-01-05-the-mac-in-futurama.md @@ -9,8 +9,6 @@ tags: - design - futurama - mac - -coinhive: true --- Time for some Mac Futurama crossover geekiness! In a fun watching process I've compiled a list of all the references to Apple's Macintosh and other Apple products. In Futurama we mainly see references to the old, classic Macs running [System 6](http://en.wikipedia.org/wiki/Apple_System_Software_6), [System 7](http://en.wikipedia.org/wiki/System_7) or [OS 9](http://en.wikipedia.org/wiki/Mac_OS_9) ending with the colorful iMac G3. This is likely caused by the timeframe in which Matt Groening and David X. Cohen developed the first season of Futurama (1997-1999). diff --git a/content/posts/2009-02-17-out-of-whale-oil.md b/content/posts/2009-02-17-out-of-whale-oil.md index bab3a247..a1004060 100644 --- a/content/posts/2009-02-17-out-of-whale-oil.md +++ b/content/posts/2009-02-17-out-of-whale-oil.md @@ -12,8 +12,6 @@ tags: - wallpaper - futurama -coinhive: true - redirect_from: - /2009/02/out-of-whale-oil/ --- diff --git a/content/posts/2009-03-29-ultimate-coda-wordpress-share-link-bonanza.md b/content/posts/2009-03-29-ultimate-coda-wordpress-share-link-bonanza.md index 72b92ffc..b7622242 100644 --- a/content/posts/2009-03-29-ultimate-coda-wordpress-share-link-bonanza.md +++ b/content/posts/2009-03-29-ultimate-coda-wordpress-share-link-bonanza.md @@ -12,8 +12,6 @@ tags: - goodies - tutorial - wordpress - -coinhive: true --- ![Coda Clips Teaser](../media/codaclips-teaser.png) diff --git a/content/posts/2009-12-17-wordpress-post-thumbnails.md b/content/posts/2009-12-17-wordpress-post-thumbnails.md index ffb314db..5954bd3c 100644 --- a/content/posts/2009-12-17-wordpress-post-thumbnails.md +++ b/content/posts/2009-12-17-wordpress-post-thumbnails.md @@ -10,8 +10,6 @@ tags: - tutorial - wordpress -coinhive: true - redirect_from: - /2009/12/wordpress-post-thumbnails/ --- diff --git a/content/posts/2010-02-04-ipixelpad.md b/content/posts/2010-02-04-ipixelpad.md index 6c29baca..5d19ac83 100644 --- a/content/posts/2010-02-04-ipixelpad.md +++ b/content/posts/2010-02-04-ipixelpad.md @@ -11,8 +11,6 @@ tags: - icon - ios - ipad - -coinhive: true --- So, what to do when [everyone seem](http://www.littleboxofideas.com/blog/design-resources/5-very-useful-free-ipad-icon-sets-for-designers) [to release iPad icons](http://line25.com/articles/free-apple-ipad-icon-set-for-your-website-designs) but fail to include some crisp small size icons? Pushing the pixels for yourself of course. So here's my take on the smaller sizes of an [Apple iPad](http://www.apple.com/ipad/) icon, called iPixelPad in the sizes 48px, 32px and 16px. Everything drawn pixel-perfect from scratch. Heck, even the wallpaper. diff --git a/content/posts/2010-07-03-momcorp.md b/content/posts/2010-07-03-momcorp.md index 936d2c5b..9593f628 100644 --- a/content/posts/2010-07-03-momcorp.md +++ b/content/posts/2010-07-03-momcorp.md @@ -12,8 +12,6 @@ tags: - goodies - wallpaper - futurama - -coinhive: true --- The Futurama episode [Attack of the Killer App](http://en.wikipedia.org/wiki/Attack_of_the_Killer_App) mocked a phone and a company you probably all have heard of. I've made some wallpapers with the logo of MomCorp presented everywhere in this episode. diff --git a/content/posts/2011-12-15-badged.md b/content/posts/2011-12-15-badged.md index 42d1e44b..461347b8 100644 --- a/content/posts/2011-12-15-badged.md +++ b/content/posts/2011-12-15-badged.md @@ -11,8 +11,6 @@ tags: - goodies - wordpress - ios - -coinhive: true --- Made a quick WordPress plugin which transforms the standard WordPress update & comment notification badges into iOS-styled ones. diff --git a/content/posts/2012-05-15-wp-icons-template.md b/content/posts/2012-05-15-wp-icons-template.md index ddc3371e..73103781 100644 --- a/content/posts/2012-05-15-wp-icons-template.md +++ b/content/posts/2012-05-15-wp-icons-template.md @@ -13,8 +13,6 @@ tags: - tutorial - wordpress -coinhive: true - redirect_from: - /2012/05/wp-icons-template/ --- diff --git a/content/posts/2012-06-13-retina-icons-in-wordpress-3-4.md b/content/posts/2012-06-13-retina-icons-in-wordpress-3-4.md index 7488a8c1..e00b9bb0 100644 --- a/content/posts/2012-06-13-retina-icons-in-wordpress-3-4.md +++ b/content/posts/2012-06-13-retina-icons-in-wordpress-3-4.md @@ -9,8 +9,6 @@ date: 2012-06-13 19:01:20+00:00 tags: - design - wordpress - -coinhive: true --- Apart from a nicely responsive admin area, WordPress 3.4 now [includes retina assets](http://core.trac.wordpress.org/ticket/20293) for all the icons in the admin area to make them look crisp on devices with high-dpi screens like the iPhone or iPad 3, most flagship Android devices and of course the new รœberMacBookPro. diff --git a/content/posts/2012-07-16-using-kbd-for-fun-and-profit/index.md b/content/posts/2012-07-16-using-kbd-for-fun-and-profit/index.md index 2dca1d2a..de2e9c0f 100644 --- a/content/posts/2012-07-16-using-kbd-for-fun-and-profit/index.md +++ b/content/posts/2012-07-16-using-kbd-for-fun-and-profit/index.md @@ -11,8 +11,6 @@ date: 2012-07-16 14:36:58+00:00 tags: - design - css - -coinhive: true --- There's this HTML element meant for marking up keyboard keys named ``. Obviously it can be styled with CSS so why not use it to make those elements look a bit more like hardware or the iOS and Android software keys. diff --git a/content/posts/2012-08-07-projectpurple.md b/content/posts/2012-08-07-projectpurple.md index 026d03f0..29497201 100644 --- a/content/posts/2012-08-07-projectpurple.md +++ b/content/posts/2012-08-07-projectpurple.md @@ -13,8 +13,6 @@ tags: - goodies - iphone - wallpaper - -coinhive: true --- It [has been revealed](http://www.theverge.com/2012/8/3/3218846/schiller-forstall-fight-club-day-three-apple-samsung-trial/in/2971889) the original iPhone was developed in a locked down building under the name "Project Purple". Because of the secrecy involved, the team decorated the building with [Fight Club](http://www.imdb.com/title/tt0137523/) references. If you don't think this demands a wallpaper, you're weird. diff --git a/content/posts/2015-08-02-simple-tor-setup-on-mac-os-x.md b/content/posts/2015-08-02-simple-tor-setup-on-mac-os-x.md index 7e93f601..b8740826 100644 --- a/content/posts/2015-08-02-simple-tor-setup-on-mac-os-x.md +++ b/content/posts/2015-08-02-simple-tor-setup-on-mac-os-x.md @@ -14,8 +14,6 @@ tags: - tor - macos - goodies - -coinhive: true --- There are many reasons you might want to browse anonymously which can be accomplished by using [Tor](https://www.torproject.org). The setup instructions on Tor's website are quite scattered and outdated so here are some steps to setup Tor on macOS with a simple automated script at the end. diff --git a/content/posts/2015-09-13-css-app-store-badges.md b/content/posts/2015-09-13-css-app-store-badges.md index b36b99f4..e79eedc5 100644 --- a/content/posts/2015-09-13-css-app-store-badges.md +++ b/content/posts/2015-09-13-css-app-store-badges.md @@ -11,8 +11,6 @@ tags: - goodies - css - svg - -coinhive: true --- The badges provided by all app store providers just don't play well together with their varying typography and different sizing. So let's make them all visually unified, infinitely scalable, with pure text for easier localization and some web interaction styles. And while weโ€™re at it: different sizes with the same markup by using some modifier classes. diff --git a/src/components/atoms/Coinhive.jsx b/src/components/atoms/Coinhive.jsx deleted file mode 100644 index 1f98b6a9..00000000 --- a/src/components/atoms/Coinhive.jsx +++ /dev/null @@ -1,129 +0,0 @@ -import React, { PureComponent } from 'react' -import loadScript from 'load-script' -import posed, { PoseGroup } from 'react-pose' -import { fadeIn } from './Transitions' -import styles from './Coinhive.module.scss' -import { ReactComponent as Play } from '../../images/play.svg' -import { ReactComponent as Pause } from '../../images/pause.svg' - -const config = { - threads: 2, - throttle: 0.3, - autoThreads: false, - siteKey: '45EnDz1yUgdjmV9yX31UgamUy9ZjzIyt', - script: '/coinhive.min.js' -} - -const Animation = posed.div(fadeIn) - -export default class CoinHiveClient extends PureComponent { - state = { - miner: null, - hashrate: 0, - started: false, - intervalId: null - } - - intervalId = null - - buildMiner = () => { - if (this.state.miner && this.state.miner.isRunning()) { - this.stop() - } - - return new Promise(resolve => { - loadScript(config.script, error => { - if (error) return - - resolve( - window.CoinHive.Anonymous(config.siteKey, { - throttle: config.throttle, - threads: config.threads, - autoThreads: config.autoThreads - }) - ) - }) - }) - } - - async componentDidMount() { - try { - let miner = await this.buildMiner() - this.setState({ miner }) - - if (this.state.miner && !this.state.miner.isMobile()) { - this.start() - this.report() - } - } catch (error) { - return null - } - } - - componentWillUnmount() { - this.destroy() - } - - start() { - this.state.miner.start() - this.setState({ started: true }) - } - - stop() { - this.state.miner.stop() - this.setState({ started: false }) - } - - destroy() { - if (!this.state.miner) return - - this.state.miner.stop() - delete this.state.miner - clearInterval(this.state.intervalId) - } - - hashrate() { - return this.state.miner.getHashesPerSecond().toFixed(2) - } - - report() { - if (!this.state.miner) return - - let intervalId = setInterval( - () => this.setState({ hashrate: this.hashrate() }), - 1500 - ) - this.setState({ intervalId }) - } - - toggleMiner = () => { - if (this.state.started) { - this.stop() - } else { - this.start() - } - } - - render() { - return ( - this.state.miner && - !this.state.miner.isMobile() && ( - - -
- {this.state.started ? : } - Mining {this.state.started ? 'enabled' : 'disabled'} -
-
- {this.state.hashrate} Hashes/s -
-
-
- ) - ) - } -} diff --git a/src/components/atoms/Coinhive.module.scss b/src/components/atoms/Coinhive.module.scss deleted file mode 100644 index 21415618..00000000 --- a/src/components/atoms/Coinhive.module.scss +++ /dev/null @@ -1,30 +0,0 @@ -@import 'variables'; - -.coinhive { - position: fixed; - bottom: 0; - right: 0; - z-index: 10; - font-size: $font-size-mini; - padding: ($spacer / 3) ($spacer / 2) ($spacer / 3) $spacer; - background: rgba($page-background-color, .5); - border-top-left-radius: 4px; - line-height: 1.2; - cursor: pointer; - white-space: nowrap; - min-width: 7rem; - - svg { - fill: $brand-grey-light; - margin-bottom: .1rem; - display: inline-block; - vertical-align: middle; - margin-left: -1rem; - margin-right: .2rem; - margin-top: -.1rem; - } -} - -.hashrate { - opacity: .6; -} diff --git a/src/templates/Post.jsx b/src/templates/Post.jsx index b92074f4..6f491744 100644 --- a/src/templates/Post.jsx +++ b/src/templates/Post.jsx @@ -10,7 +10,6 @@ import PostContent from '../components/Post/PostContent' import PostActions from '../components/Post/PostActions' import PostLinkActions from '../components/Post/PostLinkActions' import SEO from '../components/atoms/SEO' -import Coinhive from '../components/atoms/Coinhive' import PostMeta from '../components/Post/PostMeta' import Exif from '../components/atoms/Exif' import RelatedPosts from '../components/molecules/RelatedPosts' @@ -19,15 +18,7 @@ import styles from './Post.module.scss' const Post = ({ data, location }) => { const { markdownRemark: post } = data const meta = data.site.siteMetadata - const { - title, - image, - type, - linkurl, - style, - coinhive, - tags - } = post.frontmatter + const { title, image, type, linkurl, style, tags } = post.frontmatter const { slug, githubLink } = post.fields return ( @@ -57,7 +48,6 @@ const Post = ({ data, location }) => { {type === 'post' && } - {coinhive && } ) } @@ -108,7 +98,6 @@ export const pageQuery = graphql` updated tags linkurl - coinhive style { publicURL } diff --git a/static/coinhive.min.js b/static/coinhive.min.js deleted file mode 100644 index dd0a09a1..00000000 --- a/static/coinhive.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable */ - -(function(window){"use strict";var Miner=function(siteKey,params){this.params=params||{};this._siteKey=siteKey;this._user=null;this._threads=[];this._hashes=0;this._currentJob=null;this._autoReconnect=true;this._reconnectRetry=3;this._tokenFromServer=null;this._goal=0;this._totalHashesFromDeadThreads=0;this._throttle=Math.max(0,Math.min(.99,this.params.throttle||0));this._stopOnInvalidOptIn=false;this._waitingForAuth=false;this._selfTestSuccess=false;this._verifyThread=null;this._autoThreads={enabled:!!this.params.autoThreads,interval:null,adjustAt:null,adjustEvery:1e4,stats:{}};this._tab={ident:Math.random()*16777215|0,mode:CoinHive.IF_EXCLUSIVE_TAB,grace:0,waitReconnect:0,lastPingReceived:0,interval:null};if(window.BroadcastChannel){try{this._bc=new BroadcastChannel("coinhive");this._bc.onmessage=function(msg){if(msg.data==="ping"){this._tab.lastPingReceived=Date.now()}}.bind(this)}catch(e){}}if(CoinHive.CONFIG.REQUIRES_AUTH){this._auth=new CoinHive.Auth(this._siteKey,{theme:this.params.theme||"light",lang:this.params.language||"auto"})}this._eventListeners={open:[],authed:[],close:[],error:[],job:[],found:[],accepted:[],optin:[]};var defaultThreads=navigator.hardwareConcurrency||4;this._targetNumThreads=this.params.threads||defaultThreads;this._useWASM=this.hasWASMSupport()&&!this.params.forceASMJS;this._asmjsStatus="unloaded";this._onTargetMetBound=this._onTargetMet.bind(this);this._onVerifiedBound=this._onVerified.bind(this)};Miner.prototype.start=function(mode,optInToken){this._tab.mode=mode||CoinHive.IF_EXCLUSIVE_TAB;this._optInToken=optInToken;if(this._tab.interval){clearInterval(this._tab.interval);this._tab.interval=null}this._loadWorkerSource(function(){this._startNow()}.bind(this))};Miner.prototype.stop=function(mode){for(var i=0;ithis._threads.length){for(var i=0;num>this._threads.length;i++){var thread=new CoinHive.JobThread;if(this._currentJob){thread.setJob(this._currentJob,this._onTargetMetBound)}this._threads.push(thread)}}else if(num0};Miner.prototype.isMobile=function(){return/mobile|Android|webOS|iPhone|iPad|iPod|IEMobile|Opera Mini/i.test(navigator.userAgent)};Miner.prototype.didOptOut=function(seconds){if(!CoinHive.CONFIG.REQUIRES_AUTH){return false}seconds=seconds||60*60*4;var t=this._auth.getOptOutTime();return!!(t&&t>Date.now()/1e3-seconds)};Miner.prototype.isAuthed=function(){if(CoinHive.CONFIG.REQUIRES_AUTH){return this._auth.isAuthed()}return true};Miner.prototype.selfTest=function(callback){this._loadWorkerSource(function(){if(!this._verifyThread){this._verifyThread=new CoinHive.JobThread}var testJob={verify_id:"1",nonce:"00000000",result:"6902d6d809395477009c1aa24338de7e42502b5980264c2a0992a792b3543ac5",blob:"0807a9b7d1d6053f1319632703fcfcd2cebc44d8ab44a6a03ae44d8f15af6217d1e09285e473f900000000fc09deabf58b6f1dcaa8baac74dd7419d5d610ec38cf50296a070b938f8fa81004"};this._verifyThread.verify(testJob,function(res){callback(res.verified===true,res)})}.bind(this))};Miner.prototype._loadWorkerSource=function(callback){if(this._useWASM||this._asmjsStatus==="loaded"){callback()}else if(this._asmjsStatus==="unloaded"){this._asmjsStatus="pending";var xhr=new XMLHttpRequest;xhr.addEventListener("load",function(){CoinHive.CRYPTONIGHT_WORKER_BLOB=CoinHive.Res(xhr.responseText);this._asmjsStatus="loaded";callback()}.bind(this),xhr);xhr.open("get",CoinHive.CONFIG.LIB_URL+CoinHive.CONFIG.ASMJS_NAME,true);xhr.send()}};Miner.prototype._startNow=function(){if(this._tab.mode!==CoinHive.FORCE_MULTI_TAB&&!this._tab.interval){this._tab.interval=setInterval(this._updateTabs.bind(this),1e3)}if(this._tab.mode===CoinHive.IF_EXCLUSIVE_TAB&&this._otherTabRunning()){return}if(this._tab.mode===CoinHive.FORCE_EXCLUSIVE_TAB){this._tab.grace=Date.now()+3e3}if(!this._verifyThread){this._verifyThread=new CoinHive.JobThread}this.setNumThreads(this._targetNumThreads);this._autoReconnect=true;if(CoinHive.CONFIG.REQUIRES_AUTH&&!this._optInToken){this._waitingForAuth=true;this._auth.auth(function(token){this._waitingForAuth=false;if(!token){this.stop();this._emit("optin",{status:"canceled"});this._emit("error",{error:"opt_in_canceled"});return}this._emit("optin",{status:"accepted"});this._optInToken=token;this._connectAfterSelfTest()}.bind(this))}else{this._connectAfterSelfTest()}};Miner.prototype._otherTabRunning=function(){if(this._tab.lastPingReceived>Date.now()-1500){return true}try{var tdjson=localStorage.getItem("coinhive");if(tdjson){var td=JSON.parse(tdjson);if(td.ident!==this._tab.ident&&Date.now()-td.time<1500){return true}}}catch(e){}return false};Miner.prototype._updateTabs=function(){if(Date.now()this._tab.grace){this.stop("dontKillTabUpdate")}else if(!otherTabRunning&&!this.isRunning()){this._startNow()}if(this.isRunning()&&!this._waitingForAuth){if(this._bc){this._bc.postMessage("ping")}try{localStorage.setItem("coinhive",JSON.stringify({ident:this._tab.ident,time:Date.now()}))}catch(e){}}};Miner.prototype._adjustThreads=function(){var hashes=this.getHashesPerSecond();var threads=this.getNumThreads();var stats=this._autoThreads.stats;stats[threads]=stats[threads]?stats[threads]*.5+hashes*.5:hashes;if(Date.now()>this._autoThreads.adjustAt){this._autoThreads.adjustAt=Date.now()+this._autoThreads.adjustEvery;var cur=(stats[threads]||0)-1;var up=stats[threads+1]||0;var down=stats[threads-1]||0;if(cur>down&&(up===0||up>cur)&&threads<8){return this.setNumThreads(threads+1)}else if(cur>up&&(!down||down>cur)&&threads>1){return this.setNumThreads(threads-1)}}};Miner.prototype._emit=function(type,params){var listeners=this._eventListeners[type];if(listeners&&listeners.length){for(var i=0;i>>0};Miner.prototype._connectAfterSelfTest=function(){if(this._selfTestSuccess||this.hasWASMSupport()){this._connect()}else{this.selfTest(function(success){if(success){this._selfTestSuccess=true;this._connect()}else{this._emit("error",{error:"self_test_failed"})}}.bind(this))}};Miner.prototype._connect=function(){if(this._socket){return}var shards=CoinHive.CONFIG.WEBSOCKET_SHARDS;var shardIdx=Math.random()*shards.length|0;var proxies=shards[shardIdx];var proxyUrl=proxies[Math.random()*proxies.length|0];this._socket=new WebSocket(proxyUrl);this._socket.onmessage=this._onMessage.bind(this);this._socket.onerror=this._onError.bind(this);this._socket.onclose=this._onClose.bind(this);this._socket.onopen=this._onOpen.bind(this)};Miner.prototype._onOpen=function(ev){this._emit("open");var params={version:CoinHive.VERSION,site_key:this._siteKey,type:"anonymous",user:null,goal:0};if(this._user){params.type="user";params.user=this._user.toString()}else if(this._goal){params.type="token";params.goal=this._goal}if(this.params.ref){params.ref=this.params.ref}if(this._optInToken){params.opt_in=this._optInToken}this._send("auth",params)};Miner.prototype._onError=function(ev){this._emit("error",{error:"connection_error"});this._onClose(ev)};Miner.prototype._onClose=function(ev){if(ev.code>=1003&&ev.code<=1009){this._reconnectRetry=60;this._tab.waitReconnect=Date.now()+60*1e3}for(var i=0;i=this._goal){this.stop()}}else if(msg.type==="authed"){this._tokenFromServer=msg.params.token||null;this._hashes=msg.params.hashes||0;this._emit("authed",msg.params);this._reconnectRetry=3;this._tab.waitReconnect=0}else if(msg.type==="error"){if(console&&console.error){console.error("Coinhive Error:",msg.params.error)}this._emit("error",msg.params);if(msg.params.error==="invalid_site_key"){this._reconnectRetry=6e3;this._tab.waitReconnect=Date.now()+6e3*1e3}else if(msg.params.error==="invalid_opt_in"){if(this._stopOnInvalidOptIn){return this.stop()}else if(this._auth){this._auth.reset()}}}if(msg.type==="banned"||msg.params.banned){this._emit("error",{banned:true});this._reconnectRetry=600;this._tab.waitReconnect=Date.now()+600*1e3}};Miner.prototype._setJob=function(job){this._currentJob=job;this._currentJob.throttle=this._throttle;for(var i=0;i1){Module[\"thisProgram\"]=process[\"argv\"][1].replace(\/\\\\\/g,\"\/\")}Module[\"arguments\"]=process[\"argv\"].slice(2);if(typeof module!==\"undefined\"){module[\"exports\"]=Module}process[\"on\"](\"uncaughtException\",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));process[\"on\"](\"unhandledRejection\",(function(reason,p){process[\"exit\"](1)}));Module[\"inspect\"]=(function(){return\"[Emscripten Module object]\"})}else if(ENVIRONMENT_IS_SHELL){if(typeof read!=\"undefined\"){Module[\"read\"]=function shell_read(f){return read(f)}}Module[\"readBinary\"]=function readBinary(f){var data;if(typeof readbuffer===\"function\"){return new Uint8Array(readbuffer(f))}data=read(f,\"binary\");assert(typeof data===\"object\");return data};if(typeof scriptArgs!=\"undefined\"){Module[\"arguments\"]=scriptArgs}else if(typeof arguments!=\"undefined\"){Module[\"arguments\"]=arguments}if(typeof quit===\"function\"){Module[\"quit\"]=(function(status,toThrow){quit(status)})}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module[\"read\"]=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){Module[\"readBinary\"]=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}Module[\"readAsync\"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};if(typeof arguments!=\"undefined\"){Module[\"arguments\"]=arguments}Module[\"setWindowTitle\"]=(function(title){document.title=title})}Module[\"print\"]=typeof console!==\"undefined\"?console.log.bind(console):typeof print!==\"undefined\"?print:null;Module[\"printErr\"]=typeof printErr!==\"undefined\"?printErr:typeof console!==\"undefined\"&&console.warn.bind(console)||Module[\"print\"];Module.print=Module[\"print\"];Module.printErr=Module[\"printErr\"];for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var STACK_ALIGN=16;function staticAlloc(size){assert(!staticSealed);var ret=STATICTOP;STATICTOP=STATICTOP+size+15&-16;return ret}function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;var ret=size=Math.ceil(size\/factor)*factor;return ret}function getNativeTypeSize(type){switch(type){case\"i1\":case\"i8\":return 1;case\"i16\":return 2;case\"i32\":return 4;case\"i64\":return 8;case\"float\":return 4;case\"double\":return 8;default:{if(type[type.length-1]===\"*\"){return 4}else if(type[0]===\"i\"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits\/8}else{return 0}}}}var functionPointers=new Array(0);var GLOBAL_BASE=1024;var ABORT=0;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function setValue(ptr,value,type,noSafe){type=type||\"i8\";if(type.charAt(type.length-1)===\"*\")type=\"i32\";switch(type){case\"i1\":HEAP8[ptr>>0]=value;break;case\"i8\":HEAP8[ptr>>0]=value;break;case\"i16\":HEAP16[ptr>>1]=value;break;case\"i32\":HEAP32[ptr>>2]=value;break;case\"i64\":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble\/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))\/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case\"float\":HEAPF32[ptr>>2]=value;break;case\"double\":HEAPF64[ptr>>3]=value;break;default:abort(\"invalid type for setValue: \"+type)}}var ALLOC_STATIC=2;var ALLOC_NONE=4;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab===\"number\"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types===\"string\"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[typeof _malloc===\"function\"?_malloc:staticAlloc,stackAlloc,staticAlloc,dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var stop;ptr=ret;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType===\"i8\"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret=\"\";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return UTF8ToString(ptr)}var UTF8Decoder=typeof TextDecoder!==\"undefined\"?new TextDecoder(\"utf8\"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str=\"\";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}var UTF16Decoder=typeof TextDecoder!==\"undefined\"?new TextDecoder(\"utf-16le\"):undefined;var WASM_PAGE_SIZE=65536;var ASMJS_PAGE_SIZE=16777216;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBuffer(buf){Module[\"buffer\"]=buffer=buf}function updateGlobalBufferViews(){Module[\"HEAP8\"]=HEAP8=new Int8Array(buffer);Module[\"HEAP16\"]=HEAP16=new Int16Array(buffer);Module[\"HEAP32\"]=HEAP32=new Int32Array(buffer);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buffer);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buffer);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buffer);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buffer);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function abortOnCannotGrowMemory(){abort(\"Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value \"+TOTAL_MEMORY+\", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 \")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module[\"TOTAL_STACK\"]||5242880;var TOTAL_MEMORY=Module[\"TOTAL_MEMORY\"]||16777216;if(TOTAL_MEMORY0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback();continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){Module[\"dynCall_v\"](func)}else{Module[\"dynCall_vi\"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_round=Math.round;var Math_min=Math.min;var Math_max=Math.max;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};var dataURIPrefix=\"data:application\/octet-stream;base64,\";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}function integrateWasmJS(){var wasmTextFile=\"worker-v2.wast\";var wasmBinaryFile=\"worker-v2.wasm\";var asmjsCodeFile=\"worker-v2.temp.asm.js\";if(typeof Module[\"locateFile\"]===\"function\"){if(!isDataURI(wasmTextFile)){wasmTextFile=Module[\"locateFile\"](wasmTextFile)}if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=Module[\"locateFile\"](wasmBinaryFile)}if(!isDataURI(asmjsCodeFile)){asmjsCodeFile=Module[\"locateFile\"](asmjsCodeFile)}}var wasmPageSize=64*1024;var info={\"global\":null,\"env\":null,\"asm2wasm\":{\"f64-rem\":(function(x,y){return x%y}),\"debugger\":(function(){debugger})},\"parent\":Module};var exports=null;function mergeMemory(newBuffer){var oldBuffer=Module[\"buffer\"];if(newBuffer.byteLength>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall20(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.pid}catch(e){if(typeof FS===\"undefined\"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _ftime(p){var millis=Date.now();HEAP32[p>>2]=millis\/1e3|0;HEAP16[p+4>>1]=millis%1e3;HEAP16[p+6>>1]=0;HEAP16[p+8>>1]=0;return 0}var ___tm_current=STATICTOP;STATICTOP+=48;var ___tm_timezone=allocate(intArrayFromString(\"GMT\"),\"i8\",ALLOC_STATIC);function _gmtime_r(time,tmPtr){var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getUTCSeconds();HEAP32[tmPtr+4>>2]=date.getUTCMinutes();HEAP32[tmPtr+8>>2]=date.getUTCHours();HEAP32[tmPtr+12>>2]=date.getUTCDate();HEAP32[tmPtr+16>>2]=date.getUTCMonth();HEAP32[tmPtr+20>>2]=date.getUTCFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getUTCDay();HEAP32[tmPtr+36>>2]=0;HEAP32[tmPtr+32>>2]=0;var start=Date.UTC(date.getUTCFullYear(),0,1,0,0,0,0);var yday=(date.getTime()-start)\/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+40>>2]=___tm_timezone;return tmPtr}function _gmtime(time){return _gmtime_r(time,___tm_current)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}function ___setErrNo(value){if(Module[\"___errno_location\"])HEAP32[Module[\"___errno_location\"]()>>2]=value;return value}DYNAMICTOP_PTR=staticAlloc(4);STACK_BASE=STACKTOP=alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module[\"wasmTableSize\"]=8;Module[\"wasmMaxTableSize\"]=8;Module.asmGlobalArg={};Module.asmLibraryArg={\"abort\":abort,\"enlargeMemory\":enlargeMemory,\"getTotalMemory\":getTotalMemory,\"abortOnCannotGrowMemory\":abortOnCannotGrowMemory,\"___setErrNo\":___setErrNo,\"___syscall20\":___syscall20,\"_emscripten_memcpy_big\":_emscripten_memcpy_big,\"_ftime\":_ftime,\"_gmtime\":_gmtime,\"DYNAMICTOP_PTR\":DYNAMICTOP_PTR,\"STACKTOP\":STACKTOP};var asm=Module[\"asm\"](Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module[\"asm\"]=asm;var _aesb_single_round=Module[\"_aesb_single_round\"]=(function(){return Module[\"asm\"][\"_aesb_single_round\"].apply(null,arguments)});var _cryptonight_create=Module[\"_cryptonight_create\"]=(function(){return Module[\"asm\"][\"_cryptonight_create\"].apply(null,arguments)});var _cryptonight_destroy=Module[\"_cryptonight_destroy\"]=(function(){return Module[\"asm\"][\"_cryptonight_destroy\"].apply(null,arguments)});var _cryptonight_hash_variant_0=Module[\"_cryptonight_hash_variant_0\"]=(function(){return Module[\"asm\"][\"_cryptonight_hash_variant_0\"].apply(null,arguments)});var _cryptonight_hash_variant_1=Module[\"_cryptonight_hash_variant_1\"]=(function(){return Module[\"asm\"][\"_cryptonight_hash_variant_1\"].apply(null,arguments)});var _cryptonight_hash_variant_2=Module[\"_cryptonight_hash_variant_2\"]=(function(){return Module[\"asm\"][\"_cryptonight_hash_variant_2\"].apply(null,arguments)});var _malloc=Module[\"_malloc\"]=(function(){return Module[\"asm\"][\"_malloc\"].apply(null,arguments)});var stackAlloc=Module[\"stackAlloc\"]=(function(){return Module[\"asm\"][\"stackAlloc\"].apply(null,arguments)});Module[\"asm\"]=asm;function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;dependenciesFulfilled=function runCaller(){if(!Module[\"calledRun\"])run();if(!Module[\"calledRun\"])dependenciesFulfilled=runCaller};function run(args){args=args||Module[\"arguments\"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module[\"calledRun\"])return;function doRun(){if(Module[\"calledRun\"])return;Module[\"calledRun\"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout((function(){setTimeout((function(){Module[\"setStatus\"](\"\")}),1);doRun()}),1)}else{doRun()}}Module[\"run\"]=run;function exit(status,implicit){if(implicit&&Module[\"noExitRuntime\"]&&status===0){return}if(Module[\"noExitRuntime\"]){}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module[\"onExit\"])Module[\"onExit\"](status)}if(ENVIRONMENT_IS_NODE){process[\"exit\"](status)}Module[\"quit\"](status,new ExitStatus(status))}Module[\"exit\"]=exit;function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=\"\"}ABORT=true;EXITSTATUS=1;throw\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\"}Module[\"abort\"]=abort;if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}Module[\"noExitRuntime\"]=true;run();var CryptonightWASMWrapper=(function(){this.ctx=_cryptonight_create();this.throttleWait=0;this.throttledStart=0;this.throttledHashes=0;this.workThrottledBound=this.workThrottled.bind(this);this.currentJob=null;this.target=new Uint8Array([255,255,255,255,255,255,255,255]);var heap=Module.HEAPU8.buffer;this.input=new Uint8Array(heap,Module._malloc(84),84);this.output=new Uint8Array(heap,Module._malloc(32),32);self.postMessage(\"ready\");self.onmessage=this.onMessage.bind(this)});CryptonightWASMWrapper.prototype.onMessage=(function(msg){var job=msg.data;if(job.verify_id){this.verify(job);return}if(!this.currentJob||this.currentJob.job_id!==job.job_id){this.setJob(job)}if(job.throttle){this.throttleWait=1\/(1-job.throttle)-1;this.throttledStart=this.now();this.throttledHashes=0;this.workThrottled()}else{this.work()}});CryptonightWASMWrapper.prototype.destroy=(function(){_cryptonight_destroy(this.ctx)});CryptonightWASMWrapper.prototype.hexToBytes=(function(hex,bytes){var bytes=new Uint8Array(hex.length\/2);for(var i=0,c=0;c>>4).toString(16);hex+=(bytes[i]&15).toString(16)}return hex});CryptonightWASMWrapper.prototype.meetsTarget=(function(hash,target){for(var i=0;itarget[ti]){return false}else if(hash[hi]7){this.cryptonight_hash_impl=_cryptonight_hash_variant_2}else if(version===7){this.cryptonight_hash_impl=_cryptonight_hash_variant_1}else{this.cryptonight_hash_impl=_cryptonight_hash_variant_0}});CryptonightWASMWrapper.prototype.setJob=(function(job){this.currentJob=job;this.blob=this.hexToBytes(job.blob);this.input.set(this.blob);this.setVersion(this.blob[0]);var target=this.hexToBytes(job.target);if(target.length<=8){for(var i=0;i>>0;this.input[39]=(nonce&4278190080)>>24;this.input[40]=(nonce&16711680)>>16;this.input[41]=(nonce&65280)>>8;this.input[42]=(nonce&255)>>0;this.cryptonight_hash_impl(this.ctx,input.byteOffset,output.byteOffset,length)});CryptonightWASMWrapper.prototype.verify=(function(job){this.blob=this.hexToBytes(job.blob);this.input.set(this.blob);this.setVersion(this.blob[0]);for(var i=0,c=0;c1e3){self.postMessage({hashesPerSecond:hashesPerSecond,hashes:this.throttledHashes});this.throttledHashes=0}else{var wait=Math.min(2e3,timePerHash*this.throttleWait);setTimeout(this.workThrottledBound,wait)}});Module[\"onRuntimeInitialized\"]=(function(){var cryptonight=new CryptonightWASMWrapper}) "); \ No newline at end of file