One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| // Requires jQuery of course. | |
| $(document).ready(function() { | |
| $('.show-comments').on('click', function(){ | |
| var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username. | |
| // ajax request to load the disqus javascript | |
| $.ajax({ | |
| type: "GET", | |
| url: "http://" + disqus_shortname + ".disqus.com/embed.js", | |
| dataType: "script", |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="https://code.jquery.com/jquery-1.9.1.js"></script> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <input type="text" id="growthrate" placeholde="edit growth"> |
| class Prawndown | |
| constructor: (@text) -> | |
| toPrawn: -> | |
| @text. | |
| replace(/\n/g, "<br>\n"). | |
| replace(/^# (.+)/gm, "<b>$1</b>") | |
| # Use: | |
| console.log (new Prawndown("# Foo\nbar")).toPrawn() |
| var b = document.documentElement; | |
| b.setAttribute('data-useragent', navigator.userAgent); | |
| b.setAttribute('data-platform', navigator.platform ); | |
| b.className += ((!!('ontouchstart' in window) || !!('onmsgesturechange' in window))?' touch':''); | |
| // Source: http://rog.ie/blog/html5-boilerplate-addon |
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.
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.
I want to write a bit about how I've approached learning and how to learn effectively. I don't claim to be the world's foremost expert in learning but I've generalized my process to things like:
| using UnityEngine; | |
| using System.Collections; | |
| //#pragma strict | |
| //#pragma implicit | |
| //#pragma downcast | |
| // Require a character controller to be attached to the same game object | |
| // I had to initally comment out the following RequireComponent | |
| // line to make it compile and allow attaching to my Main Camera; |
git clone https://github.com/roots/sage.gitbower uninstall bootstrap-sass -Sbower install foundation -Snpm install| {% comment %} | |
| This snippet takes HTML content from the Shopify editor and parses out the first image in all sizes. | |
| Usage: | |
| {% include 'get-first-image' with page.content %} | |
| Return: | |
| {{ FirstImagePico }} | |
| {{ FirstImageIcon }} | |
| {{ FirstImageThumb }} |