I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
| const git = require('nodegit') | |
| const fs = require('fs-extra') | |
| const { URL } = require('url') | |
| const REPO_URL = '[email protected]:org/path.git' | |
| const CLONE_DIR = '/tmp/private-repo-clone-test' | |
| ;(async () => { | |
| await fs.emptyDir(CLONE_DIR) | |
| let authAttempted = false | |
| await git.Clone.clone(REPO_URL, CLONE_DIR, { |
| const repo = 'vital101/kernl-example-plugin-gitub'; | |
| const token = 'my-token-from-oauth'; | |
| const cloneURL = `https://${token}:[email protected]/${repository}`; | |
| const cloneOptions = { | |
| fetchOpts: { | |
| callbacks: { | |
| certificateCheck: () => { return 1; }, | |
| credentials: () => { | |
| return NodeGit.Cred.userpassPlaintextNew(token, 'x-oauth-basic'); | |
| } |
I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
| var $ = document.querySelectorAll.bind(document); | |
| var $_ = document.querySelector.bind(document); |
| /** | |
| * VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
| * | |
| * To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
| * It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
| * the height of element `.foo` —which is a full width and height cover image. | |
| * | |
| * iOS Resolution Quick Reference: http://www.iosres.com/ | |
| */ | |
| <script src="/js/libs/modernizr.js"></script> | |
| <script type="text/javascript"> | |
| var ua = navigator.userAgent; | |
| Modernizr.addTest('retina', window.devicePixelRatio > 1); | |
| Modernizr.addTest('webkit', navigator.userAgent.match(/AppleWebKit/i)); | |
| Modernizr.addTest('ipad', navigator.userAgent.match(/iPad/i)); | |
| Modernizr.addTest('iphone', navigator.userAgent.match(/iPhone/i)); | |
| Modernizr.addTest('ipod', navigator.userAgent.match(/iPod/i)); | |
| Modernizr.addTest('ios', Modernizr.ipad || Modernizr.ipod || Modernizr.iphone); | |
| Modernizr.addTest('android', navigator.userAgent.match(/Android/i)); |
| // Modernizr style test | |
| if (!(window.webkitMatchMedia || window.mozMatchMedia || window.oMatchMedia || window.msMatchMedia || window.matchMedia)) { | |
| var root = document.getElementsByTagName( 'html' )[0]; | |
| root.className += ' no-matchmedia'; | |
| } | |
| /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ | |
| window.matchMedia || (window.matchMedia = function() { | |
| "use strict"; |
| function sendFormByEmail(e) | |
| { | |
| // Remember to replace this email address with your own email address | |
| var email = "[email protected]"; | |
| var s = SpreadsheetApp.getActiveSheet(); | |
| var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0]; | |
| var message = ""; | |
| var subject = "New Hire: "; |
| /** | |
| * Simple localStorage with Cookie Fallback | |
| * v.1.0.0 | |
| * | |
| * USAGE: | |
| * ---------------------------------------- | |
| * Set New / Modify: | |
| * store('my_key', 'some_value'); | |
| * | |
| * Retrieve: |
An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.
Everything is broken up by tag, but within each the selectors aren't particularly ordered.
I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A
A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:
-webkit-appearance:none;