Just fun phrases that have an appropriate number of characters.
A Pen by Brittany Storoz on CodePen.
| points_to_award: function(questionPosition, inputVal, correctVal) { | |
| var points_earned, plus_seven, plus_three, plus_one; | |
| switch (questionPosition) { | |
| case 2: | |
| plus_one = (inputVal >= (correctVal - 5) && inputVal <= (correctVal + 5)) ? 1 : 0 | |
| plus_three = (inputVal >= (correctVal - 3) && inputVal <= (correctVal + 3)) ? 3 : plus_one; | |
| break; | |
| case 10: | |
| plus_one = (inputVal >= (correctVal - 3) && inputVal <= (correctVal + 3)) ? 1 : 0 |
| <img | |
| data-original="//cdn.shopify.com/s/files/1/0202/8216/products/SWORDSSMITH-KILLER-quillearring500x750_large.jpg?v=1379114870" | |
| class="lazy" | |
| style="display: inline;"> | |
| <script type="text/javascript"> | |
| (function() { | |
| $('img.lazy').lazyload({ |
| /* Some boys are playing a hockey game and they each play a certain number of shifts. */ | |
| /* For simplicity, we'll say there are 15 different shifts in a game. */ | |
| [ | |
| { | |
| "player": "Joe", | |
| "shifts": [ | |
| { "shift_start": 3, "shift_end": 5 }, // Joe started playing at shift #3, and stopped after shift #5 | |
| { "shift_start": 7, "shift_end": 11 } | |
| ] |
Just fun phrases that have an appropriate number of characters.
A Pen by Brittany Storoz on CodePen.
| var oauth = new OAuth.OAuth( | |
| 'https://marketplace-dev.allizom.org/oauth/token', // request token URL | |
| 'https://marketplace-dev.allizom.org/oauth/authorize', // access token URL? | |
| consumerKey, // user generated key from developers/api | |
| consumerSecret, // user generated secret from developers/api | |
| '1.0a', // oauth version | |
| null, // callback | |
| 'HMAC-SHA1' // signature method | |
| ); |
| { authorization: 'OAuth oauth_consumer_key="foo",oauth_nonce="yuWMpO90nLNV4UOFQbSJoIEwpKZX5Laj",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1424878605",oauth_version="1.0",oauth_signature="7HPYLjVksQ8uxVeDkgn55MWXOJI%3D"', | |
| host: 'marketplace-dev.allizom.org', | |
| accept: '*/*', | |
| connection: 'close', | |
| 'user-agent': 'Node authentication', | |
| 'content-length': 41, | |
| 'content-type': 'application/json' } |
| // index.html -- Sending message TO service worker, FROM page: | |
| navigator.serviceWorker.controller.postMessage(message); | |
| // service-worker.js -- Handling message event in service worker by posting a message back to the page: | |
| self.addEventListener('message', function(event) { | |
| self.clients.matchAll().then(function(client) { | |
| client[0].postMessage({ | |
| command: 'logMessage', | |
| error: null, | |
| message: 'hi there message here!!' |
| // Check for Service Workers and register service worker script | |
| function registerServiceWorker(workerFile) { | |
| console.log("Checking for service workers..."); | |
| if ('serviceWorker' in navigator) { | |
| navigator.serviceWorker.register(workerFile, { | |
| scope: './' | |
| }).then(function(reg) { | |
| console.log("Service Worker Successfully Registered"); | |
| enableSubmitButton(); | |
| }); |
| <!doctype html> | |
| <html> | |
| <head> | |
| <style type="text/css"> | |
| div { margin: 15px; padding: 50px; border: 1px solid #ccc; background-color: rgba(255, 192, 203, 0.24); } | |
| </style> | |
| </head> | |
| <body> | |
| <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> --> | |
| <script type="text/javascript"> |
| importScripts('dist/offliner.min.js'); | |
| // import here the plug-ins for offliner | |
| var offliner = new off.Offliner({ | |
| workerUrl: '/path/to/worker-file.js' | |
| } |